I am running some custom scripts to nag people to update their machines.
The basic idea is an pop up comes up and one button says "remind me tomorrow" and the other button says "update now". The update now is just a custom event trigger on an update policy, also available in Self Service.
I think I've got everything working properly.
Unfortunately when I test on a test machine and it works successfully, the computer is then updated and cannot be used as a test computer again.
Is there a way I can revert to a slightly older version of MacOS so I can test the scripts again?
Why don't you setup a VM and take a snapshot of it just before you run the policy to update. Then you can revert to the snapshot you took and run the test again.
You can do this as many times as you like and could always take a snapshot once you've upgraded as well and then you can easily switch between different OS versions for testing things as well