From what I made up above that will be a bit tricky though possible.
I wonder, how much separation is there between the blocks in the drawing? Mostly, do any of them overlap?
Like I mentioned above the selection works on a 'Selection set' which for a line is limited to quite a basic filter, start and end coordinates, layer, colour, line type. Other things such as line length can be inferred from the coordinates but you can't filter that.
I've been to sleep since last week... and can't quite remember your sample drawing exactly. I am thinking that perhaps the selection set could be done in 2 parts.
Something like this:
Select an object in one of your legend blocks. This will let the LISP work out the entity type (circle etc), layer, colour for all the other similar symbols
The user then selects a 'bounding box' enclosing all the symbols entities and the LISP can work out coordinates of that.
Next stage is to select all the entities in that area (based on the criteria recorded from the first entity selected - layers etc), do a count of them
Then... going back to what I did above, find all the similar entities in the drawing to the selection. These might be for example the 2 or 3 switch types also....
Now loop through this selection and apply the bounding box coordinates, modified to account for rotation and scaling to select all the object in an area around that entity (ssget with 'crossing polygon' filter)
Finally with this selection you might be able to count all the entities in there, their type, calculate the lengths of lines and confirm that this is indeed a symbol that you want to count. There count, 1.
And repeat....
The would rely however that the layer with the symbol on is reasonably uncluttered (if it was cluttered this might take a long time)
So it is possible but does need a fair bit of fiddling about to make it work ! Could be a dead useful LISP to have, perhaps taking it further to replace the individual symbol lines with a block.
Sadly not something I'll have time for this week, but with luck someone else might be able to help out and do something too