Great question. You could probably achieve this by using dbShape to perform and ANDNOT operation between the placeable area in the design and the area occupied by the macros then calling SIZEX/SIZEY operations on those shapes to identify the gaps. It's pretty tricky conceptually but...
Have you tried the finishFloorplan? It has an automatic facility for this:
finishFloorplan -fillPlaceBlockage soft 15
Let us know how this goes. It would make for a good blog post I think.