A question was asked in good faith, and an answer was found on the Internet. Many questions are resolved in precisely that manner. In general, we hope that questions that are asked here aren't so trivial that a quick Google search will find the answer, but since one is found, and since the question is constructive and on topic, it would be acceptable, and encouraged, to include the answer as an actual answer.
It's also correct to bring in the most important ideas from that link and include them in the body of the answer. If the link ever breaks, or "rots" so to speak, the answer will still have value, since it's documented.
With that said, check for any copyright notices in the forum that attempt to restrict the use of the content. Since it's user-generated content, there may be limitations on exactly what can and can't be restricted.
The only area where I might be concerned is specifically how you handled posting the answer. This seems a little too opportunistic for my tastes. If it were me, I would have left a comment for the op saying the following:
It's great that you found an answer. On SO, it's okay to answer your own question. Consider posting your answer as an actual answer to the question, which will help other users who have this same question for years to come.
I personally feel that since he did the legwork and actually found the answer, he should get first dibs at getting the reputation credit. Besides he did make the effort to come back and post the link, which in my mind deserves the opportunity to take it a step further, but as a 56 rep user, he probably doesn't know he could post it as an answer himself. It's up to those of us with more SO experience to guide users who don't, and it's up to us to reinforce and reward good behaviors.
With that said, I don't know if it's exactly wrong to take the op's link and convert it to an answer, but I'm just saying that it's probably not something I would have done without giving the op time to respond.
To look at this from another perspective, you did leave a comment explaining that it's okay to answer your own question, and you basically showed the op how to answer the question by providing more than just the link.
It really depends on the person, some op's get it and will post a really good answer while others would just post a link, leaving you in the position of then having to improve it for no reputation whatsoever.
I think what you did still has a lot of value to SO and also shows the user how SO works, just make sure you're doing it for the right reasons. :)
I guess we're damned if we do (people criticize us for hogging rep) and damned if we don't (we spend more time hand-holding new users and less time answering more questions).