This should work:
Code:
alias perl_decode {
  var %text = $1-
  var %key = secretkey
  var %response
  var %i, %j, %num ,%result
  var %text_len = $len(%text)
  var %key_len = $len(%key)
  %i = $calc(%text_len -1)
  while (%i >= 0) {
    var %chop = $right(%text,1)
    %text = $left(%text,-1)
    var %num = $asc(%chop)
    if (%num == 127) { %num = 58 }
    %num = $calc(%num - 33)
    %j = %i
    while (%j < %key_len) {
      %num = $calc(%num - ($asc($mid(%key,$calc(%j +1),1)) + %key_len))
      inc %j %text_len
    }
    %num = $calc($perl_modulus(%num,95) + 33)

    .echo -a %num
    %result = %result $+ $chr(%num)
    dec %i
  }
  return %result
}

;Perl has a very odd way of handling modulus
alias -l perl_modulus {
  if ($1 < 0) {
    var %i = 1
    while ($calc(%i * $2) <= $abs($1)) {
      inc %i
    }
    var %m = $calc(%i * $2)
    return $calc(%m - $abs($1))
  }
  return $calc($1 % $2)
}


I renamed it $perl_decode because mIRC already has an identifier called $decode. It seems to work perfectly. The biggest issue with the code (if you tried to convert it) was that Perl's % operator behaves differently than well... every other % operator I've ever seen. I think I got it working though, it seemed to work when I compared the output of some of some runs with the perl command, but if it doesn't, let me know.