Commands in the main menu like:
set "command argument1 argument2;"
are handled in idGameLocal::HandleMainMenuCommands() in game/game_loca.cpp.
For each of the parts "command", "argument1", "argument2" and the final ";" (even if this is ommitted!), the routine is called again. It therefore keeps a stack of these parts, and when it sees the final ";", handles the command and clears the stack before returning.
Even if you just use
the routine will be called twice, once with "command" and once with ";" as the menuCommand parameter.