This is possible, there is a function called Scr_Notify which can send custom notify's.
Although what exactly do you mean by onConsoleCommand?
In cod4 mods when you wanted to make an admin command work via console you had to listen to scriptmenu notifies, then the admins could use it like /openscriptmenu x which is a lot to type. I want a gsc function that allows me to make custom console commands, like for example /printbold which will call doPrintBold(msg) { iPrintlnBold(msg); }