Code:
on 1:TEXT:*:#: {
  /unset %match
  var %word = 1
  while (%word <= $numtok($1-, 32)) {
    if ($read([color:Red]yourtext.txt[/color], s, $gettok($1-, %word, 32))) var %match = $addtok(%match, $gettok($1-, %word, 32), 44)
    /inc %word
  }
  if (%match != $null) /msg $chan Found the current matching words: %match
}


that will output all matching words form the message in the channel. From there, either alter the "if($read(..." command to whatever you'd like, and remove the msg command.