Look into a library of common lisp defuns, they can be in 1 lisp or load when required, you hinted at does layer exist, its 1 line in any of your code.
(laymiss (setq lay "Mylayer") 12 "Dashed") so you would have a library defun that checks does layer exist I have hinted option color and line type.
I have library DCL routines they take 2-3 lines of code in any routine asking for values or as a replacement to Initget, they can have 1 input or up to screen limits alphabet works "A-Z" go yo Cadtutor, downloads, Multi Radio and getvals.
eg of initget as a dcl
(if (not AH:Butts)(load "Multi Radio buttons.lsp")) ; loads lisp if its not already loaded
(setq ans (ah:butts but "h" '("Yes or No" "Yes" "No"))) ; ans holds the button picked value