We give it the state=3 to take it out of the loop, making the script run once only. Alternatively, we could add a state 3 line...
:state=3:none
If it were a script that needed to constantly generate a random, we could have used...
:state=3:state=1
If we wanted it to run only while the player was within a certain distance, we could change the first state...
:state=0,plrdistwithin=50:state=1
The language is very simple and limited, but there are a lot of options.
As for the other programs, I don't know.
Best.
I'm sorry, my answers are limited. You must ask the right question.