Not declared in scope, I have no idea why this isn't working

You can do this even simpler. Click on an opening brace or bracket and the closing one is highlighted. Click on the closing one and the opening one is highlighted.