I believe "While" statements will keep looping back through the code within the current frame while the condition exists. It could be possible that the condition is never met and the computer keeps rereading the code (never advancing to the next frame) and then crash.
An "if" statement only checks the condition once and then goes on.