Hello laserdave,
yes there is a way.
Click on the event where the script shall be executed. On the right side (below the preview window) is a tab called "Event". Click on that tab, scroll down and you will see who Pangoscript options, the "On Enter" script and the "On Leave" script.
You can start a code with the command
StartCode "MyCode"
Greetings
Helyx