Well, you can freeze and thaw layers with lisp but individual entities probably not.
In VBA you can hide entities by simply setting the visible property of them to false.
To freeze a layer by referencing it's color...
Pseudo Code
Select entity with entsel
Extract entity color, if no entity color it must be bylayer
Extract entity layer
If color is bylayer extract entity layer color
;;;;for each layer in the drawing
extract layer color
test against entity color
if there is a match
freeze or turn off that layer
proceed to next layer
Sounds simple enough...
Put together some code and let us critique it....