ifとかwhileとか閉じるところに元の文をコメントで入れてみるといいよ

while a=true
if b=1 then
endif // if b=1 then
wend // while a=true

なにかしら気づくでしょ