I grouped every pair of sphere-block, after using your lisp only spheres are selected not the entire group.
another way to link them?
tried Gccoincident but only works with 2d objects
For linking purposes, I stated GROUPS, but there are more ways : XDATA, LDATA, LAYER, and so on...
Could you try to GROUP/LINK by LAYER for ex...
After your SOLIDS have been highlighted, you could qselect with LAYER matching filter, and choose non SOLID entity types, do SELECT command, press ENTER, qselect with LAYER matching filter, choose only SOLID entity types, hit DEL and finally you'll have (sssetfirst nil (ssget "_P"))...