Im kinda lost on the concept… but I got some clues from posts like these, and the documentation on events, callbacks and script clauses…
I’m guessing there’s no straightforward way to trigger an action on a delete event? 
x = modpanel.setcurrentobject $.modifiers[myCustomModifier]
when deleted do (print "bye bye")
or when this deleted do… so and so…
speaking of which… whats the point of the on deleted do, if you cant even use it without clearing your undo stack?