Code:

on *:NICK: {
  if ($newnick == $me) away $iif($newnick == nickaway,<away message goes here>)
}



You could do the opposite too...

Code:

raw 306:*: {
  set -e %herenick $me
  tnick awaynick
}
raw 305:*: {
  tnick $iif(%herenick,%herenick,$mnick)
  unset %herenick
}



That will change your nick to awaynick when you set yourself /away