Selecting an intersecting point in a line
As HISEROD pointed out, if you click on one vertex to select it, and then hold CTRL before clicking another, you will select the shortest path to that vertex:

If you indeed need a script solution, here it is:
import bpy

index1 = 105
index2 = 165

bpy.ops.object.mode_set(mode = 'OBJECT')
obj = bpy.context.active_object
bpy.ops.object.mode_set(mode = 'EDIT') 
bpy.ops.mesh.select_mode(type=&quot;VERT&quot;)
bpy.ops.mesh.select_all(action = 'DESELECT')
bpy.ops.object.mode_set(mode = 'OBJECT')
obj.data.vertices[index1].select = True
obj.data.vertices[index2].select = True

bpy.ops.object.mode_set(mode = 'EDIT')
bpy.ops.mesh.shortest_path_select(edge_mode='SELECT', use_fill=False)