Given the subject matter of your last 3 posts you should search google for similar topics by Bobby Jones. Seems I recall he has already traveled this path, and IIRC, he canned that whole mess and went with (command ".vplayer") Bobby?
If you are wanting to thaw layers in a viewport, then I suggest the VPLAYER route or an ARX solution. You can relatively easily freeze layers in a viewport by manipulating the xdata, but I'd probably still suggest VPLAYER or ARX.
If you are wanting to store and retrieve your own xdata then these functions will get you going in the right direction.