I want to modify the brackets completion plugin but I can't find a way, is even possible to do so? or I have to write a new plugin?
You have two ways to get a new brackets completion plugin.
The first one is to propose to developers a modified version in order they accept it and add it to the next update. You can do that by opening a blueprint in the Scratch website at launchpad.net
To open a new blueprint, visit https://blueprints.launchpad.net/scratch
The other way, if you know Vala, is to copy the plugin code from launchpad.com and make your changes, debug and test your plugin. Once it's ready, you can upload to your Launchpad or Github account and import it to a new branch of Scratch at Launchpad and propose it to merge.
Meanwhile developers decide, you can build it in your system to use it.