As usual, there is more than one way.
One technique, if you know the coordinates of some point on or near the edge(s) of interest, is to use the EdgeArray.findAt() method, followed with the Edge.getNodes() method to return the Node objects, and then defining a new set from them. You can use the following code for inspiration for other more complex methods you might dream up:
# Tested on Abaqus/CAE 6.12
# Assumes access from the Part-level (Assembly-level is similar):
p = mdb.models['Model-1'].parts['Part-1'] # the Part object
e = p.edges # an EdgeArray of Edge objects in the Part
# Look for your edge at the specified coords, then get the nodes:
e1 = e.findAt( coordinates = (0.5, 0.0, 0.0) ) # the Edge object of interest
e1_nodes = e1.getNodes() # A list of Node objects
# Specify the new node set:
e1_nset = p.SetFromNodeLabels( name='Nset-1', nodeLabels=[node.label for node in e1_nodes] )