Just to confirm to anyone wondering or didn't know, you can in fact get caught during the level and quit to the main menu near the end then resume the level and still get the achievement. I was caught in the middle of the level, then I quit out to the main menu right before the last checkpoint and it still popped once I got near the last door in the level.