Try replacing the # characters with a character you know won't appear in the text, like a linefeed.

Code:
alias _applyProcessor {
  %g_inputText = $replace($( $+( $, $1, %OPEN_PARANTHESIS, %g_inputTarget, %COMMA, $replace(%g_inputText,$(#,),$lf), %CLOSE_PARANTHESIS ), 2 ),$lf,$(#,))
}


Whether this works perfectly will depend on what you're calling, what it does, and what it returns.