Yes it is doable.
For instance:
def editing_group?
if Sketchup.active_model.active_entities.parent.class == Sketchup::ComponentDefinition and Sketchup.active_model.active_entities.parent.group?
return true
else return false
end
Will return a boolean to tell the script if the user is currently editing a group. BUT using methods of the selection class is independant of that.
Even if the user is editing a group, Sketchup.active_model.entities can be accessed the usual way, and Sketchup.active_model.active_entities will return a collection of entities of the active group/component.
If you have to check wether selection is a group or not, use this test:
Sketchup.active_model.active_entities.parent.class == Sketchup::ComponentDefinition
(because group are stored as if they are components !)
and if you have to check wether a particular selected object is part of a group or not, use this test:
if editing_group? and Sketchup.active_model.active_entities.include?( object_id ) ...
Hope this helps,