Maybe add
if ($1 = !quit) quit $2
So you can have a quit message.
This is a pretty basic script, Some confusing commands and some useless. This script gets a 3 from me \"Not Useful\".