When checking if things are $null, you can just negate it with !.
Ex:
if (%away != $null) && (%pm. [ $+ [ $nick ] ] == $null) {
can be
if (%away) && (!%pm. [ $+ [ $nick ] ]) {