From your example, there’s no context to evaluate if the if...end statement would be a dangling illegal snippet in that form, so depending on context, the compiler would flag it, or you would (of course) test your code to confirm it was working correctly.
I have to go out and live life now. I’ll get back with you later tonight|tomorrow.