$matchtok() will return the token instead of the tokens position in the string
$ial($nick).user or $gettok($address,1,64) return the same as $gettok($gettok($fulladdress,2,33),1,64)
Code:
if $matchtok(%BadUserIDs,$remove($ial($nick).user,~),1,33) {
  .raw $+(MODE $chan +b *!*,$ifmatch,@*,$crlf,KICK $chan $nick :,%BadUserID.KickMessage)
}