Yikes. The escape sequence will need to be changed, because I'm not going to require everybody to do, '\\' just to get a path to work.
Ahem.
Because VoiceAttack generally works with tokens(and having "\" as an escape character would cause issues by itself), I suggest something like "{LIT:}", which tells the parser to treat the contents of the token as literal.
As you've explained the way tokens are parsed, I'm hoping it'd be possible to parse every token until only the "{LIT:}" tokens remain, and then parse those as the last step.
This also ties in to the ability to allow some processing to the contents of "{LIT:}", by passing it a parameter for the recursion depth: "{LIT:{CLIP}:1}" would parse "{CLIP}", but not its contents, and because the recursion depth is "1", the token would be converted to "{LIT:Contents of clipboard}", which would then tell the parser to leave that token and its contents alone until the final pass.
I made that suggestion also in part because it's difficult to pin down a certain character that's as unlikely as possible to conflict, uncommon, and yet can still be typed on most keyboard layouts.
Aside from that, the problem of escaping the contents of variables remains to be solved.
Even something like
Set Text [Test] to '\{test\}'
Write '[Blue] {TXT:test}' to log
is currently impossible, it'll print "test" rather than the desired "{test}", and that's regardless of the escape character you choose.
I know I'm banging on about this, but I feel
Set Text [Test] to '{LIT:{test}}'
Write '[Blue] {LIT:{TXT:test}:1}' to log
Is a fair solution(though I realize the difficulty in combining it with parsing tokens from the inside out).
|{ |} or ^{ ^} or ~{ ~} (others?)
"|" Is commonly used when dealing with Linux(pipe)
"^" Is used in Excel
"~" would be an issue because people use it instead of "±", so I could see "Value is ~{DEC:value}" happening.
While it may seem farfetched to encounter such characters, I feel especially in an assistive technologies context, and when using the clipboard, you can't know whether you will.
/\ /\
((ovo))
()::)
VVV
There's a certain irony in the fact that you didn't disable smileys there