Best option is to apply for a Non O e-visa based on retirement online before you leave for Thailand. Can be applied for up to three months before you plan to leave.
Pointless to hold a visa before you are leaving. And there’s no mandatory time you’ll need to stay in Thailand to maintain your permission to stay.
***************************