This is the type of thing you do with XDoclet (template) tags. You'll be somewhat disappointed to know that there's an awful lot you can't do with the existing tags. If you were in the context of getFoo() method, you could use XDtMethod:setMethod to get the "setFoo" name, but you'll find tags of a more general nature to be rather sparse.
The general approach in 1.2 is create custom tags. It's MUCH simpler than righting
JSP taglibs. Basically, you create one single class that is your tag handler and can implement each tag as a single method on the tag handle. Something like this:
You could assign this handler to "MyTags" and generate "USER_ID" with:
I don't have any tags on this machine to cut and paste here, but the above looks right. Refer to chapter 12 of XDoclet in Action for a real example...
Oh, and no you don't have to create a full module (I assume by that you mean task/subtask/tags jar) to use a tag handler in your scripts. You can package it up or declare it using XDtTagDef...