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.
If I'm not mistaken, the loss of your rep on the accepted answer on that other question was the result of your answer being merged form it's original location to your original question. As I understand it this would not occur if the question you had answered and had been accepted for had been closed as a duplicate rather than merged.
I requested and received some clarity on merging previously but as with most things it seems it's down to the opinion of the one doing the work.