My general attitude is that as much of the original style should be preserved as possible. Yes, we're a community-edited site, but at the same time, we make individual contributions. When someone writes a post, they're the ones collecting reputation for it, and their name will always be on it, so they can reasonably expect that it will remain their post - and that includes writing style. Between your preference and the author's, theirs naturally comes first. Of course, if the original author used definitely inconsistent style, like a mix of quoting styles, editing for consistency is fine.
Of course, if something's actually wrong, edit away; leaving out capitalization and punctuation is bad grammar, not a writing style choice. If a post is so bad that it needs complete rewriting, there obviously won't be much to preserve. But if you're doing anything short of that, don't make unnecessary changes. Avoid making changes based on personal style preferences even when you're already editing, and definitely don't edit just for the sake of these changes.
When possible, also try to keep consistent style when you're adding to a post. No one expects you to be able to mimic the OP perfectly, but hey, if you're adding a sentence or two to an obviously British English post, you may as well write "colour" instead of "color". Consistency makes us all happy.
And one more less fuzzy rule: if the original author rolls back a stylistic change, don't get into an edit war. I don't think I've seen this here as much as on StackOverflow, but it's good to keep in mind!
Another way of looking at all of this: edits should make a post better, not turn it to something equally good that you happen to prefer. Keep this in mind when editing, but also when reviewing suggested edits - if an edit is just a style change, not an improvement, it's fine to reject it!