A bit complex, and someone might be able to simplify, but... I think you need two functions, one to capture i
into a closure, one to have no arguments so it can be called as a timeout.
for (var i = 0; i < 100; i++) {
(function(i) {
function loaded() {
if (!SOMECONDITION) {
setTimeout(loaded, 1);
}
};
loaded();
})(i);
};