In addition to Wims comment: for historical reasons, the scripting language does not have "" quote support for strings. This means that quotes are treated as a literal part of the string in most cases. This also means that the ( ) , cannot be used directly as these are part of the $identifier(a,b,c) format. You would need to escape these characters:
//echo $replace( $+(":,$chr(41),") , $+(":,$chr(41),") , $+("1,$chr(44),8:,$chr(41),") )
Or without the quotes, which I assume is what you wanted:
//echo $replace( $+(:,$chr(41)) , $+(:,$chr(41)) , $+(1,$chr(44),8:,$chr(41),) )
Or put them in variables:
var %a = ":)"
var %b = ":)"
var %c = "1,8:)"
//echo $replace( %a , %b , %c )
and without the quotes:
var %a = :)
var %b = :)
var %c = 1,8:)
//echo $replace( %a , %b , %c )