Prevent code lost

Hi can you develop an alert to prevent code lost if i i change from script to other options if scriot has code?
see picture