for the first question:
1) Should I check the box 'a distribution was overpaid and I authorize
the redeposit or 'a distribution was withdrawn in error'?
Select "a distribution was overpaid and I authorize the redeposit"
That describes your situation. If you accidentally used the debit card attached to the HSA when you didn't intend to, that would be the second situation described in the question.
2) These distributions were in 2017. Will I get an amended 1099 and
have to amend my 2017 tax return? This is something I'd like to avoid.
The forms I have seen ask if the money was from this year or last year. So for the money for last year, check the box saying it was from last year. This isn't unusual, I had a provider that insisted that we pay the full amount using the debit card even though everybody knew a portion was going to have to be refunded. It also occurs when there is a rebate for some prescriptions.
The question is what did you specify on your 2017 tax form. The HSA administrator knows how much they distributed and indicates that on the 1099. They have no idea how much was for legitimate medical expenses. That part of the tax form you supply.
So if the money was withdrawn and returned before the tax year you should have redeposited it before the tax year. Then the 1099 would have reflected the redeposit. If the money was returned in 2018, even if you knew in 2017 some amount would be returned, then you could legitimately prove that the numbers on your tax form were accurate.
I don't think you would have to update your previous tax return, unless the amounts involved are crazy large. Just redeposit the money, accurately fill out the forms, and document everything you do/did so if there is an audit you can defend your actions.