@Martyn *********
, You can apply for an in-country Non-O visa now if you want. You can leave Thailand and back if you apply for a re-entry permit as well. So Technically, it'd be possible if you travel with your plan.
You are in Chiang Mai, so the sample schedule would be:
1. Apply for 30 days tourism extension on 1 Aug.
2. Apply for in-country Non-O on 1 Aug - you will get an "under consideration" period on your receipt (not on your passport) for 15 working days
3. You go back to the Immigration office on 23 Aug to get in-country Non-O based on retirement for 90 days in your passport. Gives you until 21 Nov
4. You apply for a re-entry permit (single) on 23 Aug AFTER you get a Non-O stamp
5. You travel abroad 1 Sep - 1 Oct. Enter Thailand on re-entry permit, stamped until 21 Nov again.
6. after middle Oct apply for 1-year extension based on retirement
What you'd better check with the Immigration officer when you apply for 30 days tourism extension to make sure the schedule above is workable are :
a) Ask If IO would contact you during the first Non-O (90days), then make sure it's okay with them that you are out of Thailand on those schedules
b) If you can apply Non-O with your tourism extension application (which can save you one trip to the CM office and 1 day from your schedule)
When you want to apply in-country Non-O is up to you and your preferences.