fix semi-colon insertion after 'if {'

Move the `if`, `else` special checks earlier in the code path. Fixes the issue re: `if {` having a semi-colon auto-appended.