Here's my code with the various changes that you've requested implemented.
Code:
on *:text:*:#:{
  tokenize 32 $strip($1-)
  var %a = 1, %b = $0
  while %a <= %b {
    if $remove($gettok($1-,%a,32),$chr(44),$chr(36)) isnum 100000- {
      .msg $chan The number $gettok($1-,%a,32) was said.
    }
    inc %a
  }
}