This sounds perfectly fine to me--in general, I and my team already does this because it's helpful to know WHY we chose a course of action, especially when it was complicated enough to require SO's help.
What is reasonable attribution?
A URL as a comment in your code is reasonable attribution.
There are certainly other forms of reasonable attribution, depending on use, and you are welcome to go above and beyond what’s required and include username, date, and anything else if you like.
You are also welcome to use the MIT License as it is traditionally interpreted: by preserving the full license with relevant fields (copyright year and copyright holder) completed.