Looking at the code more thoroughly, you might want to change it to this:
(defun c:clang (/ *error* sysvar values )
;; Error Handler to reset System Variables if things go wrong
(defun *error* ( msg )
(mapcar 'setvar sysvar values)
(if (not (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*"))
(princ (strcat "\nError: " msg))
)
(princ)
)
;; Store current System Variables
(setq sysvar '(CMDECHO CLAYER)
values (mapcar 'getvar sysvar)
)
;; Set System Variables
(setvar 'CMDECHO 0)
;; If "Sketch" layer exists...
(if (tblsearch "LAYER" "Sketch")
;; Unlock it, Thaw it, Turn it On, and set it current
(command "_.-layer" "_U" "Sketch" "_T" "Sketch" "_ON" "Sketch" "_S" "Sketch" "")
;; Otherwise create it (also sets it current)
(command "_.-layer" "_M" "Sketch" "_C" "_Cyan" "Sketch" "")
)
;; Tell user what's about to happen...
(prompt "\nOnce you enter a value this puts a an angled XLine at your pick point...")
(setvar 'CMDECHO 1)
;; Create the Angled XLine:
(command "_.xline" "_a")
(while (= 1 (logand 1 (getvar 'CMDACTIVE)))
(command pause)
)
;; Reset System Variables
(mapcar 'setvar sysvar values)
(princ)
)
Since the XLines are now being placed by the user, there is no need to change the OSMODE setting.