Kudos for asking so constructively. I think your reaction/approach was entirely reasonable.
In general we tend not to like link-only answers. There are several reasons. For instance, links often die. However, those reasons probably don't apply here. For instance, it seems hard to imagine a situation where Stackoverflow disappears from the Internet but Ask Different remains. That said, it never hurts to supplement your answer by adding a summary of the main idea from the other answer you are linking to, so the best solution is probably to provide a link to the detailed answer on Stackoverflow and add a short summary to your answer here.
It is OK to copy from someone else's answer, as long as you provide suitable attribution and link to that other answer.
The only place where I disagree with grgarside's excellent answer -- and I admit it's a small nit -- is that I think there's no need to mark your answer as community wiki. Community wiki is only appropriate in those very rare cases where massive collaboration from the community is needed; this is extremely rare and I don't see why it would apply to your situation. I would suggest you leave your answer as an ordinary answer (don't make it community wiki) -- I think your answer is helpful, and I'd prefer to be able to upvote it and have you receive the rep for your useful, well-written, well-researched answer. If you want to remove community wiki status, you can flag your answer for moderator attention and ask them to remove the community wiki status.
Thank you for your valuable contributions to Ask Different. I hope you will keep contributing!