I think it would make sense to have a directory (a special snip) called groovy, and all snips as childs of that are supposed to be groovy code.
Basicaly that could be done with any scripting language ...
To invoke such a snip you would write {groovy:snip-name} or {jython:snip-name} etc.