How to stop execution of a python script on state change?

Yeah somehow I f** up the PR and I just couldn’t find it anymore. I made a new one. Can be watched here https://github.com/home-assistant/home-assistant.github.io/pull/5279

~Cheers