Craft CMS Redactor formatting
You can use JavaScript to edit the Redactor settings, but the correct answer here is to add the settings with JSON config files. Those should go into your /craft/config/redactor folder.

Take look at the Redactor Styles plugin though – it will add a couple of textareas to your CP for adding custom Redactor JSON and/or CSS, which should make this a bit easier.