As long as both flights are international flights, you can stay "airside" and not clear customs. There should be a transit desk to confirm your onward flight.
you can it from your Amphur office where your marriage is registered, it shows your marriage is still valid, it cost about 30thb or mine has been free last two visits.
you have to be "airside" (booked in and through customs) this can only be done 2 or 3 hours before your flight, if your in the terminal public areas you are still counted as being in Thailand.
As I understand it a Thai citizen will get blue book, only foreigner have a yellow, unless your own a condo where its agreed a foreigner can you a blue book. As already started you need to go to the Amphur office, locally.