Depends on what banmask you want to use, and if you want to check for a repetition "by nickname", or e.g. "by hostmask".

Example:
- if the same nickname punct-flooded
- a second time
- within the last 3 hours (the script will "forget" the first offense after 3 hours)
- in the same channel
- on the same "network" (more precisely: on the same server connection)
...it will ban the users hostmask (*!*@host.domain)
Code:
on @*:TEXT:*:#: {

  ; change "20" to the desired limit
  if ($regex($1-,/[.!?]/g) > 20) {

    var %count = $v1, %limit = $v2
    if ($hget(punctflood,$+($cid,$lf,$chan,$lf,$nick))) {
      ban -k $chan $nick 2 banned: repeated punctuation flood ( $+ %count punctiation marks - limit is %limit $+ )
      hdel punctflood $+($cid,$lf,$chan,$lf,$nick)
    }
    else {
      kick $chan $nick Punctuation flood (your messsage contained %count punctuation marks - limit is %limit $+ )
      hadd -mu10800 punctflood $+($cid,$lf,$chan,$lf,$nick) 1
    }

  }
}