Drinks on me. Got >10% raise this morning from my current employer after giving notice yesterday that I accepted another job. It's been a stressful process and looking forward to a few cold ones after work tonight.
I'm glad you got the recognition you deserve, sorry that it took going this far for them to appreciate you, and hopeful that this episode doesn't make them think you are disloyal to them. Never hurts to know that there are other options out there, too!
The most common advice is never take the counteroffer. However my company is also one of the rare places that legitimately will try to convince someone to stay, I've seen it happen several times and the folks are still here.