Here's a related post on Meta.Stackoverflow: Can I answer my own questions, even those where I knew the answer before asking? and there's also a blog post titled, quite clearly, It’s OK to Ask and Answer Your Own Questions.
The official network policy is to explicitly encourage this behavior. If the question and answer pair represent good content, we want it here!
However, the question and answer must still stand up to the ordinary scrutiny applied to other posts. The question must not be too localized, which occasionally happens on these posts. The answer must be high-quality and detailed; it should explain why it is the best solution to the problem, not just "well, this seemed to work for me."
In this case the original answer was low-quality, but after edits it looks like valuable content that we want to have on the site.