I think you are asking for a clean way to exit a LISP routine by pressing ESC and you don't want to see the normal garbage. There is a way. The following statements go inside your LISP routine:
1) Save the existing error function with this statement:
(setq olderr *error*)
2) Define a new function to intercept the ESC or other errors with something like this:
(DEFUN NewErr(s) ; Error handler
(SetVar "OSMODE" om)
(SetVar "CMDECHO" 0)
(setq *error* olderr)
(setq ans "An Error has ocurred")
(prompt ans)
(princ)
)
3) After the DEFUN in (2) above include the following:
(setq *error* NewErr)
3) At the end of your LISP routine, to make sure the error functin is restored to it's previous setting, add:
(setq *error* olderr)
This will hopefully get you started.