Not sure what you are asking. Looping is an animation/timeline option. You normally set the frame delay and looping before saving. As far as I know you can't set looping during a save with Photoshop( script or manually ).
If you want to set the looping option, you should be able to do that with code from the scriptlistener plug-in. Here is an example from Photoshop CC. Not sure if it will work in older versions because Adobe changed the name of the animation panel to timeline.
function loopForever() { var desc = new ActionDescriptor(); var ref = new ActionReference(); ref.putEnumerated( stringIDToTypeID('animationClass'), charIDToTID('Ordn'), charIDToTID('Trgt') ); desc.putReference( charIDToTID('null'), ref ); var desc1 = new ActionDescriptor(); desc1.putEnumerated( stringIDToTypeID('animationLoopEnum'), stringIDToTypeID('animationLoopType'), stringIDToTypeID('animationLoopForever') ); desc.putObject( charIDToTID('T '), stringIDToTypeID('animationClass'), desc ); executeAction( charIDToTID('setd'), desc, DialogModes.NO );
};