Copy and move group several times to make a polyhedron

(1) In order to use the SketchUp API, you’ll first need to learn core Ruby. (I created a wikilist of catagorized learning resources in the Ruby API forum category.)

The repeating (looping) constructs are part of core Ruby, which has an Enumerable library module that is “mixed-into” most collection type classes, that adds in even more looping methods.

(2) The best way to learn SketchUp scripting is to look at the examples in the Examples and Utilities example extensions of the SketchUp Team. Use them as templates, changing the outermost namespace module name to something unique for you.

Start simple, by creating 2D geometry on the ground plane. (You’re failing because you are attempting to jump ahead immediately to a complex 3D task.)

When you master simple tasks, move incrementally to more and more complex tasks, and study more complex examples.

http://extensions.sketchup.com/en/users/sketchup-team

(3) Copying, moving and rotating requires learning to create transformations, and apply them to groups and component instances.

This is fine, which would mean the origin for the group would be the center of the group. (Transformations are based on the origin of the instance, so you’d draw the face edges relative to a center origin.)