If you try to make your indentation match your curly braces - something that should be matched up at all times - then you’ll find that you can’t, because the curly braces are mismatched
A crude but effective enough method to narrow down where the problem is, is to remove about half (save it elsewhere) and run again. If the problem remains then it’s in the half you kept, otherwise it’s in the half that you removed in which case bring some of it back. Repeat until identified.
You can also run it with some other interpreter, typically there’s a line number accompanying error messages.
I was only saying that there’s at least one problem that you shouldn’t be running into just because of keeping the formatting tidy.
There isn’t a } for each { - they’re only allowed in pairs, one at the start of a block and one where that same block ends. If you indent by the curly braces, then the result is that the code doesn’t come back all the way to the left side, some block is still not closed.
If there are other syntax problems, then as suggested earlier - temporarily remove stuff until it is valid syntax, fix the last thing removed, and add the rest back