Get out of a loop / goto:

Break can be used to exit a for loop. Would this help?

for (;;) {
    (do stuff)
    if (digitalRead(blah) == 1) break;
}