“Basically you can utilize the Google Apps Scripts, here is what I did: pastebin.com/4pNBJ9pC. In order to enable it you need to create a new script: Tools » Script Manager » New and paste the code there. Then you will have to authorize the script and reload the document so that the menu appears on in the menu bar. Then select a patch of text and pick Extras » Apply code style”

From: How do I add new styles to Google docs? - Web Applications Stack Exchange

As of August 2016, this still works. The menu items have changed, and the script editor is rather different I think, but once the script has permissions, it works as expected.