Deductions & credits

I should have said there was nothing in the tax code that required a repayment option.  It seems your plan administrator allows one.  If putting the money back would allow you to re-use it for another eligible medical expense within the time limits of your plan, that would be the least-tax option.  But if you can't use it for another medical expense (due to the carry-forward limit or the end of the grace period) then keeping the money and paying the tax on it would make the most sense to me too.  Your steps are correct.