It's possible to do string comparison with a normal TypoScript "globalString" condition and a constant:
[globalString = LIT:foobar = {$some.typoscript.constant}] ... [global]