This is a better solutin (I can't lay claim to it all, most of it was kindly provided by the people on these forums).

Code:
on ^*:TEXT:*:#:{
;First, we check to make sure the "Show status" option is enabled within mIRC.
;If it is, use this:
  if ($gettok($readini($mircini,options,n2),30,44) == 1) {
      echo -bfrtmli $+ $len($timestamp) $chan ( $+ $iif($left($nick(#,$nick).pnick,- $+ $len($nick)),$+(,$color(text).dd,$ifmatch,)) $+  $+ $colour(notice) $+ $nick $+  $+ ) $1-
  }
;If it is disabled, use this:
  if ($gettok($readini($mircini,options,n2),30,44) != 1) {
      echo -bfrtmli $+ $len($timestamp) $chan $+(,$chr(40),,$nick,,$chr(41),) $1-
  }
haltdef
}