Cleaning script to cut face edges
Do a while pop().  

Check out the answer here, shows the return geometry of running bmesh subdivide edges operator. Iterate with python on vertices created by subdividing an edge

Notice the geom_inner returns the 3 newly created faces of the one cut subdivided plane.  Could use sets to check the difference before and after.

Also note the original faces are not lost in the process.  Some bmesh ops are destructive.  It appears sub edges builds on input geometry.

For your example, rather than counting the iter could simply copy the faces before, and do a while pop

faces = bm.faces[:]
while faces:
    f = faces.pop()
    # op


btw there is no need to use a selection here, simply collect the edges

edges = []
e = face.edges[0]
if e is interesting:
    edges.append(e)


and feed edges into the operator.  Unless using a bpy.ops.mesh operator there is often very little reason to use selection... unless the select is part of the desired result.  Note there is also a more temporary tag property.

No need to cast strings to strings

print(str("string")) # not required
print("string") will do.