Below is a script that should work.
The lines starting with a # are commensta describing what the line below does.
Let me know if it helps:
import rhinoscriptsyntax as rs
#define a the method
#let user select objects restricted to curves (filter 4)
curve_objects = rs.GetObjects('get curves', filter = 4)
if not curve_objects: return #no selection made
#sort the objects by object name
curve_objects.sort(key = lambda curve: rs.ObjectName(curve))
#create a list of midpoints
mid_points = [rs.CurveMidPoint(curve) for curve in curve_objects]
#create a polyline from the points
#run the method