For rPWBC scripts/clean_sandbox.py would it be possible to add a -oldid:N flag where N would be the number of the permanent link/revision ID of the page is a clean state? Pywikibot can then attempt to restore the page to that revision (if it [still] exists e.g. not deleted/revdeleted/suppressed) otherwise the script should exit with error.
This could also be used to revamp or simply the script code making it wiki agnostic instead of either patching it for each wiki or using the -text: argument (which by the way it doesn't look it support line breaks?)
Thank you.