/system backup containing previous version of edited scripts?

Well, that already exists! You can place an export file on a router (in a 16MB flash router you need to put it in the flash folder) and then you can start a reset-configuration with run-after-reset option with the name of that file. (also use the option to not make a backup and not install the defaults)
That will import the file right after the reset and the router should be back. And indeed, I have used that before on a remote router where I had the suspicion that the binary configuration was somehow out of sync with the viewable text version. Which turned out not to be the case.

There are issues with it. After some version somewhere in the 6.35..6.39 timeframe it stopped working because the script was started “too soon” after the boot and the router was not ready to accept the config commands. So it silently failed. This has not been fixed even today, but it can be remedied by putting a /delay 30 at the top of the file. (download it, edit it, and re-upload)

However, there are other possible issues! I have recently posted 2 of them in the 6.49 thread. Sometimes the export is just invalid and has to be edited before being imported, and as you cannot see what goes wrong in those run-after-reset scripts it is very hard to find out what it is.

I had more luck using the method of resetting the router without defaults, then use winbox to connect to MAC address (can only be done on a local router…) and then use /import verbose=yes filename. This will print the imported file while it imports, so when it stops you can see what it is importing at that time. You can also continue the import on the next line (with the skip option to skip the lines before).

But it is a tedious process that can only be performed by a person with good knowledge of RouterOS. There should be more clever handling of issues encountered during import that are not really fatal.