Thanks for the tip.
In spite of my best efforts, I have never been able to the get the dollar-expansion to work for me in set expressions. Furthermore, the documentation shows that you're supposed to write it as $(#=[expression]), but the examples I've seen omit the hash sign.
Maybe it has to do with the fact that the field I'm restricting values for is an AND field (although I fail to see how pre-processing a string value would make any difference).
Even if I could get this working, this seems a bit excessive given how most other formula and programming languages have simpler ways to escape characters.
Hopefully the product managers of QlikView will address this in their next release.