Is there a certain amount of time you must leave Thailand after purchasing a re-entry permit in order for it to remain valid, please? I vaguely recall seeing that you must purchase it the same day you leave Thailand but I might be misremembering (the mind is a terrible thing ...) and now I cannot find relevant info. There's nothing on my old re-entry permit stamps that gives a clue about this.
I'd want to be able to leave Thailand about 4 days or so after I purchase the re-entry permit. (I realize this is an odd scenario.)
TLDR : Answer Summary
A re-entry permit in Thailand remains valid until your current visa stamp expires, regardless of when you purchase it. Therefore, you can buy the re-entry permit and leave Thailand up to 4 days later without any issue.