Until subscription webhooks are added (which are still at the ‘exploring’ stage on the Roadmap) you will need an app that either listens to the channel subscriptions topic on pubsub, or connects to chat and listens to subscription events there, which will then execute the script you want to run.