Please give this a try, it should be within 10 seconds.
#target bridge;
if( BridgeTalk.appName == "bridge" ) {
tenStack = MenuElement.create("command", "Ten Second Stack", "at the end of submenu/Stack");
}
tenStack.onSelect = function () {
//Change to suit
///////////////////////////////////
var Secs = 10; ///
//////////////////////////////////
Secs = Secs * 1000;
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
var folder1 = Folder(app.document.presentationPath);
var fileList = folder1.getFiles(/\.(jpg|jpe|jpeg|gif|eps|dng|bmp|tif|tiff|psd|crw|cr2|rle|dib|cin|dpx|ps|pcd|pict|vda|icb|vst|wbm|sct|pbm|flm|psb|exr|pcx|pdp|nef|dcr|dc2|erf|raf|orf|tga|mrw|mos|srf|pic|pct|pxr|pdd|pef|png|x3f|raw|rw2)$/i);
var fileArray = new Array();
for(var a in fileList){
var md = new Thumbnail(fileList).synchronousMetadata;
md.namespace = "http://ns.adobe.com/xap/1.0/";
var dateTime = new XMPDateTime(new Thumbnail(fileList).metadata.read("http://ns.adobe.com/exif/1.0/","DateTimeOriginal")).getDate().getTime();
fileArray.push([[decodeURI(fileList.name)],[dateTime]]);
}
fileArray = fileArray.sort(function(a,b){return a[1]-b[1];});
while( fileArray.length > 2){
count=0;
tmpArray=[];
tmpArray.push(fileArray.shift());
cmp = Number(tmpArray[0][1]) + Secs;
count = getCount(cmp);
for(var y =0;y <count;y++){
tmpArray.push(fileArray.shift());
}
if(count > 0) {
app.document.deselectAll();
for(var s in tmpArray){
var splitIt=tmpArray.toString().split(',');
app.document.select(new Thumbnail(new File(app.document.presentationPath + "/" + splitIt[0])));
}
app.document.chooseMenuItem("StackGroup");
}
}
function getCount(){
count=0;
for(var g = 0;g<fileArray.length;g++){
if(Number(fileArray[1]) <= cmp){
count++;
}else{break;}
}
return count;
};
};