I do see one problem. apparently 3D Text and Shape layers don't get detected as AVLayers, so you need to expand the if logic to something like this:
if (((myLayers[i] instanceof AVLayer) || (myLayers[i] instanceof TextLayer) || (myLayers[i] instanceof ShapeLayer)) && myLayers[i].threeDLayer)
When I do that, your lightsOn() code seems to work for me.
Dan