AutoLisp/VisualLisp is incapable of doing two things at once - that's due to ADesk implementing the lisp interpreter into one single thread. Thus you cannot send anything to the command-line while some other lisp code is running and waiting for user input.
You can attempt to circumvent this by using some form of
SendKey's through ActiveX - but the problem is it might work in some cases while in others it might not. The SendKeys is asynchronous (otherwise it would be the exact same thing as if using command / vl-cmd) and thus would not give any benefit to AutoLisp. But, since it's asynchronous you can't say for sure when the keystrokes are actually sent to the command.
But the biggest problem is sending an Esc this way would cancel all running lisp, including your own routine.
Could you post some code instead of describing your problem? It might be that you can rewrite some to go about it a different way. I can't actually understand why you'd want to cancel a call to ssget.