Text::Template is the perl module RT uses for templates.
It uses { and } for template delimiters.
http://search.cpan.org/~mjd/Text-Template-1.45/lib/Text/Template.pm
should show you how to escape your templates - specifically:
http://search.cpan.org/~mjd/Text-Template-1.45/lib/Text/Template.pm#JavaScript