How can I add a new socket to a node and then make that socket connected to a property
If I understand the question correctly, you want to set node inputs values.

Say you have added texture node so that it can be accessed like so, for instance:

node=bpy.data.textures['Texture'].node_tree.nodes['Texture']


Then input slots are already created and you don't need to create the slots.

You can for instance:

node.inputs[0].default_value = (0,0,0,1)
node.inputs[1].default_value = (1,1,1,1)


An easy way to identify Python accesses is to use the tooltips:



To connect texture node output for blend node first input:

import bpy

tree = bpy.data.textures['Texture'].node_tree

texture_node = tree.nodes['Texture']

blend_node = tree.nodes['Blend']

tree.links.new( texture_node.outputs[0], blend_node.inputs[0] )