Based on what I was able to figure out from what you did post, the following worked on 3 networks that I can use the /trace command on
Code:
on *:text:*:#:{
  if $hget(Trace,0) {
    .enable #trace
    .trace $nick
  }
}
#trace off
raw 200:*:{
  .hadd -m Trace $4 $addtok($hget(Trace,$4),$5,32)
  haltdef
}
raw 204:*:{
  .hadd -m Trace $4 $addtok($hget(Trace,$4),$5,32)
  .disable #trace
  haltdef
}
#trace end
raw 008:*:{
  .hadd -m Trace 0 $iif(O isincs $usermode || C isincs $v2 || a isin $v2 || N isincs $v2,$true,$false)
  haltdef
}
on *:start:{
  if !$hget(Trace) {    .hmake Trace 100  }
  if $isfile($qt($scriptdirTrace.hsh)) {    .hload Trace $qt($scriptdirTrace.hsh)  }
  .hadd -m Trace 0 $iif(O isincs $usermode || C isincs $v2 || a isin $v2 || N isincs $v2,$true,$false)
}
on *:exit:{
  .hsave Trace $qt($scriptdirTrace.hsh)
}
on *:disconnect:{
  .hsave Trace $qt($scriptdirTrace.hsh)
}


If you'll post the actual code for that event, it would help allow me to either alter your code to work with the format that mine is using, or alter my code to work with the format that yours is using.