Here is a script that I wrote quickly and havn't tested.
It sets the channel limit 5 above the actual people in the channel until the limit is reached then it updates the limit.
If the limit is reached 3 times in the space of 1 minute it will lock the channel down for 5 minutes.
Feel feel to play around with the numbers to suit your own needs.
on @*:join:#channel:{
if (($nick(#,0) == $chan(#).limit) || (!$chan(#).limit)) {
if (%floodcheck == 2) {
mode # +im
.timer.unlock 1 300 mode # -im
}
else {
mode # +l $calc($nick(#,0) + 5)
inc -u60 %floodcheck 1
}
}
}
on @*:part:#channel:if ($nick(#,0) < $calc($chan(#).limit - 5)) mode # +l $calc($nick(#,0) + 5)