How to delete wire in sketch by script

Hello everyone, I want to delete some wires in sketch, just like the red wires. And add some wires, just like the green. Now I have got the vertex coordinates. How to complete this job? If you have some idea please share it here, thank you!

I have attempt some ways just like below script, It will delete some lines incorrectly.

s = mdb.models['Model-1'].ConstrainedSketch(name='__edit__', 
objectToCopy=mdb.models['Model-1'].sketches['Sketch A'])
g, v, d, c = s.geometry, s.vertices, s.dimensions, s.constraints
s.delete(objectList=(g.findat(right1[0]), ))
mdb.models['Model-1'].sketches.changeKey(fromName='__edit__', 
toName='Sketch A')
s.unsetPrimaryObject()