My experience has shown that the *error* function is best defined as local to the main application function.
eg
(defun c:test ( / *error* ... )
(defun *error* ( msg )
;; stuff here
)
;; stuff here
; force a clean-up
(*error* nil )
(princ)
)
If you define *error as global it will stay in memory and be re-used for any following errors. ... something that may not be required if you are making specific restorations or changes to the environment.
A general guideline is "Leave the environment as you found it". I've seen cases where a user defined global *error* routine has caused real debugging problems in other routines.