ECP has a bunch of variables that allow you to set things. Basically they are the ECP Options affecting things like whether the flies script is turned on. You could have a trigger in the mission
Type: End#2
Condition: flyscriptvariable
if the variable was true the mission would end immediately. This is only a theory, you'll need to make further investigations of ECP. If you don't understand fully how to use it as an editor you will struggle to acheive something tricky like this. Fortunately the documentation is pretty good, have a good read through it.