The script originally posted had a bug that would cause some layers in multi-nested structures not to get selected (the parent layers would not expand, therefore preventing selection). Here is a version with the bug fixed, for anyone interested that is using the script:
DIG_SelectObjectsLayers.rvb (2.3 KB)
The command/alias is: DIG_SelectObjectsLayers
–jarek