Part of the problem is the fact that you're using isin rather than ison (and I missed it). Here's a re-write of the code that has been tested
Code:
 on @*:text:!warn*:#: {
  if ($nick isop $chan) && ($2 ison $chan) {
    msg $chan $2 $+ , You have been warned by $nick for: $3-
    set $+(%,warn,.,$2) $iif(!$($+(%,warn,.,$2),2),1,$calc($($+(%,warn,.,$2),2) + 1))
    if $($+(%,warn,.,$2),2) == 3 {
      .kick $chan $2
      unset $+(%,warn,.,$2)
    }
  }
  else {
    msg $chan $2 is not in the channel.
  }
}