look into $awaymsg also this snippet does not set you as away on the server it only changes ur nick and sends a amsg saying ur away/back
also you may want to add a bit of error checking to this..