PaulS:
It is pointless to suggest using Tools + Auto Format, when there is clearly mis-matched curly braces. Tools + Autp Format won't work when the number of { and the number of } are not equal.
Auto Format works just as well when the number of { and the number of } are not equal. Whilst it will not (cannot) correct the error, it makes the fact that there are missing or extra brackets/braces more obvious.