OK, so coming from the other direction, you enter the layer names to exclude from greying. If certain layers are always excluded you need to hard code a list of their name so they can be excluded automatically. See line with red text comment
(defun c:foo (/ *error* c_doc c_lyrs x_lst lyr_lst x_it lyr_name)
(defun *error* ( msg )
(if (and c_doc (= 8 (logand 8 (getvar 'UNDOCTL)))) (vla-endundomark c_doc))
(if (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*")) (princ (strcat "\nOops an Error : " msg " occurred.")))
(princ)
);end_*error*_defun
(setq c_doc (vla-get-activedocument (vlax-get-acad-object))
c_lyrs (vla-get-layers c_doc)
x_lst (list "0" );;ADD/CHANGE ALWAYS EXCLUDED LAYERS HERE
);end_setq
(vlax-for lyr c_lyrs
(if (not (vl-position (vlax-get-property lyr 'name) x_lst)) (setq lyr_lst (cons (strcase (vlax-get-property lyr 'name)) lyr_lst)))
);end_for
(while (not x_it)
(setq lyr_name (getstring T "\nEnter Layer Name to Exclude : "))
(cond ( (and (> (strlen lyr_name) 0) (vl-position (strcase lyr_name) lyr_lst))
(setq lyr_lst (vl-remove (strcase lyr_name) lyr_lst))
)
( (= (strlen lyr_name) 0) (setq x_it T))
(t (alert (strcat "Layer : " lyr_name " Not present in this drawing")))
);end_cond
(setq lyr_name nil)
);end_while
(if (and c_doc (= 8 (logand 8 (getvar 'UNDOCTL)))) (vla-endundomark c_doc))
(vla-startundomark c_doc)
(vlax-for lyr c_lyrs
(if (vl-position (strcase (vlax-get-property lyr 'name)) lyr_lst) (vlax-put-property lyr 'color 252))
);end_for
(if (and c_doc (= 8 (logand 8 (getvar 'UNDOCTL)))) (vla-endundomark c_doc))
);end_defun
Otherwise it works as before
I am not one of the robots you're looking for