If you really know the answer, go for it, answer immediately. (It's also still fine to let others answer, of course - sharing the work and the rep isn't a bad thing.)
That said, the linked meta.SO answer is a bit oversimplified, and mainly focused on etiquette to do with reputation. But it's also important to try encourage other answers, so that we end up with the best possible answer. (This is why Area 51 cares about answers per question on new sites.)
You should use the "answer your own question" feature in the ask question page, so that they're actually posted simultaneously. This avoids the situation where your answer appears as someone's starting to write their answer, which is really discouraging - you think "oh, there's no way they'll accept mine now" - and some users will even give up on posting their answer. (We all wish they'd still post, but people are people, and this kind of thing happens.)
You should be careful not to make your question too specifically tailored to your answer; it's easy to accidentally do this when you're writing both at the same time. Try to write the question first, asking the actual question you think many people will have, then write the answer. Keep it general if you can, avoiding arbitrary and unnecessary restrictions. Don't assume that your answer is going to be the best; leave room for different answers that might be even more useful.
You should be vigilant about upvoting and accepting deserving answers besides your own. The rest of the community needs to vote too, of course, but make sure and do your part. It's important to be willing to accept other answers, not just assume that yours will be the best. Be careful to try to judge based on what other readers will want, not the preconceptions that led to your answer; since you already knew the answer, you're choosing an answer on behalf of others. Though people obviously don't know you'll do this while you're writing, if someone took the time to write something that's at least as good as what you did (or possibly better), they deserve the credit. (The system tries to help you with this by delaying your ability to accept an answer.)
If you're not totally confident about your answer, note how it's incomplete or potentially wrong, and be ready to edit or delete it. Otherwise, consider not posting immediately. Like it or not, there's a bit of bias in the system with people upvoting the first answer, and upvoting the top answer, sometimes leading to undervalued second answers. If the question is unanswered, or if the top answer clearly shows room for improvement, it gives others more incentive to perhaps do a bit of research and write out a good answer themselves. (Again, ideally they'd do this either way, but sometimes people do get discouraged, feeling their potential rewards have been diminished.)
Remember, it's not just about doing something that's okay according to the rules, it's about acting in a way that gets us the best possible questions and answers. This is perhaps even more important when you're answering your own question. You're essentially attempting to directly generate good content, so you should act in a way that encourages that good content, no matter whom it comes from. It's about what you should do, not just what you have to do.