Perl regexes currently don't provide a reasonable way to extract or modify a complete parse tree from a recursive regex match. In other words, because the independent subpatterns in your (?(DEFINE)...) block don't keep the substrings they capture, it's extremely difficult to extract that hierarchical information and convert it to something else using substitutions involving vanilla recursive regexes. Basically, all you can do is match the regex and extract the entire match as a single string...or at best, extract just the top-level components.
in reply to substitute with recursive regexps?
If you want to do something more sophisticated than that using regexes, you need the extra features provided by the Regexp::Grammars module. Have a look at the distribution's demo/ subdirectory for some examples of parsing and then manipulating arithmetic expressions (in particular: the various demo_calc*.pl files).
And, yes, it's unfortunate that Perl now has the equivalent of full grammar-based matching, without any facility for extracting useful information from such matches. I know that Damian Conway and Nicholas Clark were discussing that very limitation (and what might possibly be done about it in a future version of Perl) at YAPC::EU a few weeks ago, so maybe Perl will eventually get a native implementation of that missing feature as well.
But in the meantime, have a look at Regexp::Grammars (or Marpa or Parse::Yapp). Perl 5 regexes aren't (yet) full grammars and that seems to be what you want here. Any of those modules can give you that, and Regexp::Grammars can give it to you in (decidedly non-vanilla) regexes.