Well, it doesn’t work in object mode either, because you can’t set the crease of an edge in object mode Why not set the crease in edit mode and then switch to object mode for use_seam?
Are you just trying to turn sharp edges into creases? You’re going to need to use bmesh for this.
import bpy
import bmesh
obj = bpy.context.edit_object
me = obj.data
bm = bmesh.from_edit_mesh(me)
for e in bm.edges:
if not e.smooth:
e.crease = 1.0
bmesh.update_edit_mesh(me, False)