Tampermonkey has an export feature in the utility tab. You can even auto upload to dropbox, google drive, or onedrive. I just export all once in a while so that I can still dig all my code out if something bad happens to my computer or I'm not at home.
edit: You can still lose stuff in local storage with fancy scripts that let you save things, but some of those have their own backup options. Actually, I just looked, and tampermonkey also has the option to save all of the local storage on export, so that's really all you need.