Do you want the resize to be constrain. What kinds of layers. Do you want the resized layer to fit within the document's canvas? If the resized layers is smaller then canvas size but part of the layer is off canvas do you want the layer repositioned onto the canvas. If so how. You have a lot of design work to do before you start coding.
You will has a difficult job resizing smart object layer. A smart object layer's object is not changed the results of the object being transformed is used as the smart object layers pixels and the Object transform setting are recorder into the smart object layers data. So the layer sized and the objects size may be very different. The recorded transform may also be warping. distortion and positioning the object for he layers content use in the document.
If this is going to be your first script you may want to only random resize normal image layer. Each resize though will loose some image quality. Its not a script that I would want or write.
Then Transform with a random Percent between 50 to 100. Should work. Set the same Percent for width and height Set set default interpolation to bicubic smoother. Remember each transform will degrade the layer quality more. Its a destructive process and the layer's size will keep getting smaller.