@Andie **********
Okay. Assuming you were married in the UK, let the marriage certificate legalize in the UK about 1½ -2 months before you go to Thailand again. First at the UK Ministry of Foreign Affairs, then at the Thai Embassy. Apply for a Non-O visa and mention it's for marriage (not retirement). When you arrive in Bangkok, the certificate must be legalized by the Thai Ministry of FA. For that you need a Thai translation, done in Bangkok by a certified translator (you could do it in the UK, but then it's not sure that it will be accepted by the Thai Ministry). You can also authorise the translator to do the legalization; for that you need a copy in accordance with the original from the UK Embassy. But you can also go to the second floor of the MFA building, there is a translation office. Make an appointment beforehand online with the MFA for the day after (it's often busy, so for the same day is risky). After legalization register the marriage certificate in the Amphoe of your wife's address. You get a Kor Ror 22 which you need for extension of the Non-O visa based on marriage, which you can do after two months after opening a bank account (see below). Important: don't forget to let your wife register your stay on her address with a TM30 within 24 hrs after your arrival there . You could do that online, but the website is very complicated. Best go to the Immigration Office together, she can fill in a TM30 there. If the UK Embassy doesn't provide an affidavit regarding your income (I'm lucky because I'm Dutch, the Dutch Embassy does), you should open a bank account shortly after your arrival and put 400,000 baht on it. It should be clear that the deposit is from the UK. To be sure that the bank doesn't refuse to open an account, you can get a Certificate of Residence from the Immigration Office, which you can collect when you are there for the TM30.
It seems a lot, but when you prepare well, but it's doable.
For your present situation I wouldn't worry: normally two border runs are allowed, as long as it's clear you're a tourist.