Right, I haven't gotten much further with this, but what I have realised is that the bulk of the "work" that the AutoXLSTable tool does is within Excel itself - we have an Excel worksheet with column headers for the "floor" each item is on, coupled with normal and rotated options for most of the 200+ blocks. Then down the left hand side is a row for each of the blocks.
When you run the AutoXLSTable tool, it searches all the commented cells in the worksheet and populates each cell accordingly. Something I hadn't spotted before now is that the AutoXLS - generated comments are in the following format:
Attcount(BlockName,LayerName,AttributeName,AttributeValue) eg. AttCount(XXX-3612D,*All*,FLOOR, Floor B)
&
Length(GroupName,LayerName,Precision) eg. Length(USER02-B,*All*,0.001) (The "-B" signifies Floor)
This then would explain the seemingly hours (if you take into account that we've been using it for 5 years!) of time each of us has sat waiting for the BoM to populate.
I think it would be much faster to simply pass a list of the currently inserted blocks sorted by the Non-anonymous BlockName* to Excel rather than, (as seems to happen now) search through the entire blocktable on each commented cell - of which there are more than 3000 if you take into account 200+ (rows) x 2 (normal or reverse blocks) x 8 (possible floors).
As for the Groups, I was planning on implementing something (loosely) similar to this:
http://www.theswamp.org/index.php?topic=30413.msg361848#msg361848But using the groupname to grab only the groups I need. With that in place it should simply be a case of iterating through each group (that matches our required naming convention) and adding together the length of the polylines contained within.
Then I can pass those values back to my BoM command.
*Currently, the AutoXLSTable tool doesn't support Dynamic blocks - because I assume they tend to end up as *U22 etc?