Update a custom property after leaving edit-mode?
You can subscribe to changes in an objects mode.
import bpy

# Create a unique object as a handle for the subscriber.
my_handle = object()


def my_notify(a, b, c):
    print(a, b, c)

def register():
    bpy.msgbus.subscribe_rna(
        key=(bpy.types.Object, &quot;mode&quot;),
        owner=my_handle,
        # Can be anything, passed to 'notify'.
        args=(1,2,6),
        notify=my_notify,
    )

def unregister():
    # Clear on unregister.
    bpy.msgbus.clear_by_owner(my_handle)

register()
```