I agree this isn't ideal. Is this something you often run into? I am wary of making things more complicated, rather than more simple and reliable.
There are some edge case bugs already with inserting closing brackets, and skipping over them. Here, what happens when you are moving around the code? What happens if you enter a semi-colon between the curly brackets, and then jump to the end of the line?
I am not sure how to approach fixing this without making things more complex and possibly unreliable most of the time. It's the edge cases where things get complex.