Immigration is ambiguous in Thailand. It is designed to allow, shall we say, flexible enforcement. I would not try the process myself. You will need a Thai lawyer. I'm not sure the internet is a good place to find one.
My advice would be to visit Thailand and talk to people who have retired there an actually bothered to get the visa. Find out what attorney they used. There are probably a lot of people applying right now, as the visa laws have been changed and enforcement tightened. It used to be quite easy to live there for years, taking a bus out of the country every thirty days and coming right back in. This has become a lot more complicated recently. Some people are going to a Thai consulate outside the country and paying for a sixty day visa, and repeating that process over and over. But there are stories of people not getting in even with the visa.
Look at
Home - Thaivisa.com for information, and of course, the Thai consulate website for your country.