Which characters do you want to be considered "caps" and "non-caps"? A-Z are uppercase, a-z are lowercase, 1-9!@#$%^&*()etc have no case. You need to decide which ones you want to unclude. The following code considers A-Z vs a-z... all other characters are ignored:

on *:text:*:#:{
  if (%caps.floodprotection) return
[color:red]  var %var,%temp = $regsub($1-,/[^A-Za-z]+/g,,%var)
  tokenize 32 %var[/color]
  if ($len($1-) <= 5) return

Add the red parts to the previous code. The rest is identical.