So you want to add variable support... A quick look at the source:
In cmd.c (which is part of the tremulous executable, not cgame), there are functions named Cbuf_*(), which are related to command line processing. Console and script commands are executed by adding them to the console buffer (as '\n'-terminated character strings), which are then executed every frame, or when you explicitly call Cbuf_Execute(). To add to the console buffer, use the Cbuf_AddText or Cbuf_InsertText commands, or you can use the Cbuf_ExecuteText to execute-right-now.
That said, inside these 3 latter commands, you can edit and replace the $* characters with characters of the corresponding variable value. Note: for the ease of programming, you can store variables in cvars, named as $*, if you prefer. Note2: I don't see '$' being used anywhere in the command line processing, so normally, '$' will not conflict with anything. (If it will, you'll might want to replace variables in known commands, such as /say. But don't bother yourself with this.)