Code:
alias web.parser {
  var -s %r = $1-
  while ( < isin %r ) {
    var -s %r = $left(%r,$calc($pos(%r,<,1) - 1))) $mid(%r,$calc($pos(%r,>,1)))
  }
  var -s %r = $replace(%r,$chr(32),$chr(0160),$chr(0160) $+ $chr(0160),$chr(0160))
  var -s %r = $replace(%r,’,',á,á,ï,ï,é,é,ö,ö,ë,ë,$chr(38) $+ $chr(35) $+ 039 $+ $chr(59),$chr(39),$chr(38) $+ quot $+ $chr(59),$chr(34),$chr(38) $+ amp $+ $chr(59),$chr
(38),”,$chr(34),’,',“,$chr(34))
  return %r
}


Try that...
I saw that you were creating a string of a $left, $mid(s) and a $right of the $1- that removed all &lt;<unknown>&gt; occurances, I didnt really see why you would build such a string of identifiers rather than just make the new string, if there was some reason then likely mine wont work either. Butr if it does thats all im doing also, then i do your replaces and return.

I cant see why it would freeze up on the return it looks like a simple replace, your always going from a bigger to a smaller string so it should never "string length to long" on you either.

* i left in -s on the VAR command so you can watch the progress of it in the status window, if it works but still freezes up this might give you some clues. If it works without problem now, just remove all the -s from the var commands.