It is already in the API... e.g.
Sketchup.active_model.definitions.find_all{|d|
!d.group? && !d.image? }.each{|d|
d.save_thumbnail("#{d.name}.png")
}
This basic code saves the components' SKP files into your default-folder, as set up in SketchUp's Preferences - probably your 'Documents' folder...
Obviously you can expand this basic code quite a lot...