Code:
on *:text:*:#:{
  var %caps = $regex($1-,/[A-Z]/g)
  if (%caps > 5) { msg $chan Stop talking in $round($calc(%caps / $len($1-) * 100),2) $+ % and stuff $nick }
}


The above is untested, but it should work.