Dan,
This is beautiful, thanks.
I only have one suggestion, which would be to move the condition entirely into the <case> par, for improved readability of the templates, like this:
<switch>
<case @foobar@ true>
...
</case>
<case @baz@ eq "greble">
...
</case>
...
<case default>
...
</case>
</switch>
That would make it easier to read the template, because you don't have to read both the <switch> statement and the <case> statement to find out what's going on.
/Lars