CB Auto Actions can do this using its Code action. It can do so on CBSubs subscription state changes using the below as well.
Plan Active
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions
1: [var3] Equal To PLAN_ID_HERE
2: [var2] Equal To A
Plan Expired
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions
1: [var3] Equal To PLAN_ID_HERE
2: [var2] Not Equal To A
You can actually use whatever action you like. Code, Query, Field, etc.. There is however no CBSubs specific integration to execute PHP and no plans for one, sorry.