If you want to just keep it easy and stick to border runs, use a border bounce agent. 4000-5000 baht. Leave very very early AM and be back before dinner. They make sure you get out and back in without any issues as part of the service.
If you're on an extension based on marriage to a Thai and your spouse dies, you'll be allowed to stay until your extension ends. But you will not be able to apply for a new extension based on that reason.
If however you get divorced, your extension ends the day the divorce is finalized.
then you're not on a non-B. You're on an extension based on work. And therefore YOU MUST CANCEL this before you leave. Your school cannot do it. It's in your passport, and it's your extension. You must get a letter from your school stating your last day of work and then take this to get your work permit cancelled, and then take your cancelled work permit and the letter to the immigration office that issued your extension and get it cancelled there. Most immigration offices will allow you to do this 1-2 weeks before the date on the letter. They will cancel your extension and then stamp you in through the date on the letter.
Anonymous participant 629 did you even read what I wrote? They cancel their EXTENSION. They are not on a visa. DTV people are on a VISA. A VISA cannot be cancelled. If someone enters Thailand for work on a non-B visa and they stop working within that first 90 days, they can stay the entire 90 days because they're on a VISA that cannot be cancelled. If they're on an extension and stop working then that EXTENSION ends the same day the reason for that extension ends.