@Lion_Ts
A6.31.4 C-Script (and earlyer) does understand if-structures without {} (having only one following command, which can be another if, to create what you posted).
Your if structure in C-Script looks like this:
if (expression) {
} else { if (expression) {
} else { if (expression) {
} else {
} } }
And is aweful to count the amount of closing-brackets.
So why the while?
To be able to jump to the end of the fake-switch by using break;.