On the GHPython SDK mode side of things, one can reliably (in my experience at least) subscribe and unsubscribe to events using the __enter__ / __exit__ methods:
__enter__
__exit__
Edit: This appears to work if I understood the problem correctly: