It's more efficient doing it like so:
on $*:TEXT:^!(exit|leave)$:#:{ var %1 = $regml(1) if (%1 == exit) quit lastbattlescript, requested. else %1 # lastbattle }
In case you don't know. The command /leave is a deprecated command (yes, it still works) for /part command. They work exactly the same.