24 years and the OP could have been either a PR or a citizen by now, and this wouldn't have been an issue. Sounds like he was totally eligible the entire time.
Whatever the case, as others said, get your social security health insurance locked in. You only have 6 months post finishing work to sign up for it (a one off thing too), but at 432 baht per month for near universal coverage, it is remarkably good value.
https://www.thaicitizenship.com/thai-social-security/