AutoCAD 2008: Global Error Checking Lisp

Hi,
I'm trying to build a global error checking routine such that, if a custom lisp command is escaped mid-way through, the user's settings
are returned to their previous state (i.e. before the command was issued).
I found just such a routine at http://www.afralisp.net/lispa/lisp6.htm and have attempted to adapt it for my purposes but something's not right. For instance osnaps are not restored to their original setting.
Below, I've included the handful of statements that top and tail my own custom lisp routine, together with the error checking routine (slightly modified from the original). Any thoughts:
-- (defun c:gea () (initerr) ;error checking (command "_.undo" "_g")...
...(command "_.undo" "_end") (reset) (princ) )
--


;;;error trapping, based on a script provided by K. Ramage at
;;;http://www.afralisp.net/lispa/lisp6.htm
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.