The answer is in the guide. To duplicate a layer you use the duplicate method. Duplicate allow you to move as well as dupe but if you still need to move the layer you use the move method. To make a layer part of a clipping group you set it's groured property to true. And to merge you use the merge method. So if I had a document with three layers named top. middle, and bottom.
// dupe and move the layer name bottom so it is above top
var dupedLayer = app.activeDocument.artLayers.getByName( 'bottom' ).duplicate( app.activeDocument.artLayers.getByName( 'top' ), ElementPlacement.PLACEBEFORE );
// make it part of a clipping group with the layer below
dupedLayer.grouped = true;
// merge with the layer below
dupedLayer.merge();
If you wanted more layers in the clipping group you repeat the grouped = true step as needed. If there are more than one layer in the clipping group you could merge each layer in the group down until there are no more grouped layers. Or you could find the base layer and apply the merge to that layer. When you merge the base layer of a clipping group it merges the group not merge down.
EDIT: c.pfaffenbichler beat me to this. And agree, it is easy and in the object model viewer ( or scripting guide ). The only part that is not covered by the guide is how merge can either merge down or merge group depending on if the layer being merged is the base of a clipping group.