replacing a space with an _ is a bad idea. What if I want to reverse "this_is_a_test" you've just changed all those _ to spaces giving a result of "tset a si siht" which is incorrect. Instead, you should take advantage of the fact that mIRC does allow you to have a space at the beginning of a variable, just not at the end and therefore you can use:

alias reverse { 
  var %x,%i = 1 
  while ($mid($1-,%i,1)) {
    %x = $ifmatch $+ %x
    inc %i 
  return $strip(%x)

That is obviously going to be much faster since there are no $replace's involved.