That is line 34 on your original code. There is an extra ; character after the if - that denotes the end of the if statement, which is immediately followed by a block which is independent of the if statement, therefore the following else clause is not applicable. You should remove the ; on that line
And even with experience, we don't necessarily stop making the mistake, but all the practice we've had making it makes us better at recognizing it when it happens.
Don't get me started about those stupid light bulbs.