As the author of the original answer you based yours on, I personally have no problem with you accepting your own if it better served your needs.
I will admit to a bit of confusion on my part when I saw the accept come and go and come and go, but that's not really relevant.
The most important thing to me is that questions get quality answers and the site as a whole is improved by our actions. I perceive this question and both answers as worthy of upvotes. As far as rep goes, I believe you get 2 points for accepting an answer not your own and nothing for accepting your own answer if you care.
Personally, I've accepted answers and upvoted answers that led me down the right path and posted my own tuned answer that worked best for me inspired by the original answer as an alternative along with testing results to indicate why the alternative existed.
I've also accepted my own answer on occasions where there were no other quality answers provided. Ultimately the right to choose is yours.