CTRL-T does a pretty good job of formatting the code.
Except: Does a poor job job on arrays, spreads them all over the page.
Use the Tabs feature in the IDE to break the code up into scrollable chunks.
I use the Named tab as an intro to keep notes, test status, things to fix, change descriptions. Then:
a_presetup - start of real sketch; #includes, #defines, pin assigments, variable declarations, arrays etc.
b_setup - normal setup code
c_loop - start of loop code
d_loop - more loop if needed
e_end_loop - etc.
f_functions - or would be if I actually wrote any
Code seems to compile alphabetically starting with tab a.