Some things...
You may want to add a list of people you've already notified so you can't get flooded off the server too easily. Also, you should make use of the server command "away".
yes make use of the $away an $awaymsg so you wont have to set global vars
yes make use of the $away an $awaymsg so you wont have to set global vars