I don't know of a script to do this, but it shouldn't take all that long to do by hand.
The # column in the timeline indicates the layer number -- you can see the number of layers in each comp by scrolling to the bottom of the timeline. Just make sure
shy layers [link] are not hidden.
You can quickly select a comp and all the precomps within it by navigating the project flowchart [link] and hiding footage, solids, and layers. After you expand all the precomps within a main comp in the flowchart, you can lasso them all and they will select in the project panel. You can open them all from there with Enter on the numeric keypad.
Walter Soyka
Principal & Designer at
Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
RenderBreak Blog - What I'm thinking when my workstation's thinking
Creative Cow Forum Host: Live & Stage Events