Your code currently makes everything in the model.active_entities have the specified material.
Because the imported geometry arrives inside a component your code gives that material to the instance - NOT its contents.
Faces inside a component [or group] that have no material applied to them [front or back] will initially show in the default material.
Then if you give the 'container' a material then those faces will be displayed as if they had that material, BUT they are actually still in the default material.
If you want to give a material to the faces inside a component you need to use something like this.
Assuming that you want every face in the model to use that material...
Sketchup.active_model.definitions.each{|d|next if d.image?; d.entities.each{|e|next unless e.class==Sketchup::Face; e.material="green"; e.back_material="green"}}To ALSO process any faces in the model's entities use this:
Sketchup.active_model.entities.each{|e|next unless e.class==Sketchup::Face; e.material="green"; e.back_material="green"}You can obviously mess around with materials and so on...
You could even limit the change to the imported component [its component name ISN'T the same as the dae file so we must get all components before we start and then find which one was [or ones were] added by the import]...
ds=Sketchup.active_model.definitions.to_a; ###add your importer code here...; ds=Sketchup.active_model.definitions.to_a-ds;###ds is an array of just the imported component[s]; ds.each{|d|d.entities.each{|e|next unless e.class==Sketchup::Face; e.material="green"; e.back_material="green"}} 