Because his code is deleting any char that is not 0-9a-z or space or control code and then count the lenght, your is doing the contrary :p
A version with [:punct:] will be :
on @*:TEXT:*:#: {
if ($regex($1-,/[:punct:]/gSi) > 50) { kick # $nick used %punct punctuation marks to flood }
}