Code:
on *:INPUT:*: {
  var %replacer = [color:Red]this,is,a,list,of,words,to,be,replaced[/color]
  var %replace = [color:blue]this,is,what,they,should,be,replaced,with[/color]
  var %r = 1, %msg = $1-
  while ($gettok(%replacer, %r, 44) != $null) {
    var %from = $ifmatch, %to = $iif($gettok(%replace, %r, 44), $ifmatch, %from)
    var %msg = $replace(%msg, %from, %to)
    /inc %r
  }
  /msg $active %msg
  /halt
}


that should work a little better. Basically, set the first variable (marked with red) to the word being replaced, and the blue portion to the one to replace it with. Seperate the sections with commas. For example, if you wanted all the instances of "cat" to change to "dog", and "fish" to change to "parrot", you could use:

var %replacer = cat,fish
var %replace = dog,parrot


-KingTomato