well, the absolutely easiest is by making a normal End trigger, and just put something like scriptEnded in the condition field, after which you would at the end of your script put "scriptEnded=true" (without the quotes). That way the end trigger won't activate before the script is completed...
although there is a command,
forceEnd which supposedly ends the mission too...last time I checked it didn't work tho, but you can try it out anyway
g'luck!
Wolfrug out.