Dan,
Here is a tip that may help you out...
If you have multiple names for the layers you want filter for, here's an easy way of doing it...
(ssget (list (cons 8 "LAYER1,LAYER2,LAYER3...")))
So if you use a WHILE loop in your entget area, you could concatenate your layer names into one big string and supply that to the SSGET function.
Do you follow me?