mIRC IRCv3 tags: help!

raw *:*: {
  if $nick == tmi.twitch.tv {
    if PRIVMSG isin $rawmsg {
      tokenize 59 $rawmsg
      ;echo -t @raw rawmsg tokens num: $0 1: $1 2: $2 3: $3 4: $4 5: $5 6: $6
      set %displayname $remove($2, display-name=)      
      set %subscriber $remove($4, subscriber=)
      tokenize 32 $6-
      ;echo -t @raw tokens num: $0 1: $1 2: $2 3: $3 4: $4 5: $5
      set %usertype $remove($1, user-type=)
      if (%displayname == $null) { set %displayname $mid($2, 2, $calc($pos($2, !) - 2)) }            
      set %msgtype $3
      set %chan $4
      set %msg $mid($5-, 2, $len($5-))
      ;echo -t @raw %msgtype on %chan (usertype: %usertype sub: %subscriber $+ ) < $+ %displayname $+ > %msg
      echo -t %chan < $+ $iif(%usertype != $null, @, $null) $+ %displayname $+ > %msg
      if (%displayname != bot_name) { parsecommand %msg }
      unset %displayname
      unset %subscriber
      unset %usertype
      unset %msgtype
      unset %chan
      unset %msg
    }
    elseif CLEARCHAT isin $rawmsg {
      tokenize 32 $rawmsg
      var %chan = $3
      var %user = $remove($4, $chr(58))
      if %user != $null {
        ;echo -t @raw user %user timed out on %chan
        echo -t %chan ** %user has been timed out. **
        inc %bancount
        if (%chan == %mainchannelname) { hashstore bancount %user }
        if $inlist(%user, %unbanlist) { msg %chan .unban %user }
      }
    }
    elseif NOTICE isin $rawmsg {
      tokenize 32 $rawmsg
      echo -ts tokens num: $0 1: $1 2: $2 3: $3 4: $4 5-: $5-
      var %chan = $4
      var %notice = $mid($5-, 2, $len($5-))
      echo -t %chan ** %notice **
    }
    else { $null }
  }
}