It will most likely be easier to reformat using a regular expression:
:%s/;/;\r/gc
:%s/}/}\r/gc
:%s/{/{\r/gc
etc.
to insert a line after; or { }.
(if you are confident enough or the file is long, do not use it c, it will ask for confirmation for each match)
, gg=G .
, gq =