Code:
In this particular case it is a custom plugin for CBSubs that is activating plans when the user is buying some merchandise. I could maybe replace it by autoactions, but this plugin is much more convenient because it can be configured in the "integrations" of a particular merchandise, and if I copy this merchandise to a new one also the integration settings get copied.
You can do this with a single auto action per plan or if you've multiple plans activating the same plan they can share the same action. Yes making a new merchandise requires a new action, but that's just a matter of copying the action and changing the plan id. All of which would eliminate the need for you to maintain custom code.
I don't see what such an integration has to do with firing CBs registration triggers though. It does not sound like your integration is coded properly to act on a subscription state change or payment.
Instead of trying to write all of this custom code that you have to maintain I recommend fully describing what you want to accomplish and we find a solution to automated all of this. We do not assist with custom coding so this will become further problematic as you have more issues.