I don't think this would solve the underlying problem, which is that some people (thankfully relatively few) do not put as much effort as they could/should into writing their questions. Even if the code were auto-formatted nicely (which would be quite a challenge to do in such a way as to please everybody), it wouldn't fix the rest of the rambling, typo-strewn, unfocused content. (So maybe we need a 'prettify post' button that gets rid of personal complaints, extra punctuation, and fixes word choice, spelling, etc. :) )
For people who want to ask a good question or give a good answer, the burden of code formatting is very small compared to coming up with a good post.
In some ways, it's actually helpful to see a poorly formatted post. If the asker is unwilling to put forth the effort to format it reasonably, it's a good indication that the question is not worth your time.