you should just be able to compare the edge indices of v1.edges and v2.edges. if they have entirely unique edges (the two verts are not connected by an edge), there’s already an edge between them.
bm = bmesh.new()
bm.from_mesh(bm_obj.data)
bm.verts.ensure_lookup_table()
bm.edges.ensure_lookup_table()
vertices = [vertex for vertex in bm.verts]
for i in range(len(vertices)-1):
if not(set(vertices[i].link_edges) & set(vertices[i+1].link_edges)) :
bm.edges.new((bm.verts[i],bm.verts[i+1]))