edge.use_seam isn't working
It's only obvious if you know how blender works. What is happening is the mesh data is copied into a bmesh structure when you go into edit mode, this bmesh data is copied back when leaving edit mode. The changes you make to the underlying mesh data while the mesh is in edit mode are overwritten by this process and won't affect the mesh that you see in edit mode.

If you move your set use_seam loop to above the set edit mode you will get the result that you expect.