Well, it depends..
I am not aware of a "direct hit" method but there is workaround:
in example: you could use a global variable of the terminal as a semaphore; when a particular scrip is run it would set a global variable as its ID, and it would run as long as it is set; from there another program (i.e. EA or indi or script) could "see" this particular ID, and reset it if needed, in order to stop the script.
But you should know such methods, these are basic stuff, I am not gona teach you all and everything. read the docs and think what you can do with all the functionality that you have at hand.