It's easy :
Set a Trigger.
Make a link to the trigger in your script-code, decide what happens if the trigger is active (Mission won, Misson lost etc.) Set ABattle.doSingleBattleSuccess(bool) or Campaign.battleSuccess to true if won and false if lost.
Ok will make a Sample Mission for that.