Saves code to localStorage before running it to prevent losing code in case of browser crashing/freezing