We partially spoke about this in chat, but for completeness:

Unassociate will contact the plugin to notify it that the unit has been removed, which explains the need for api.initialize() above. To be honest, I'm not 100% sure of the long reaching implications of this. I'm going to put some thought into what sorts of things the migration framework needs to initialize prior to calling the scripts after this review. The solution for now may be to just delete the record directly from the DB.