Probably yet another one of those obvious things, but ...
To avoid losing your customized code, save it somewhere offsite in a Notepad document or a similar format that (unlike, e.g., Word) doesn't add a whole bunch of bells and whistles of its own. If things ever get messed up on you or you accidentally hit "reset template" (or even if you do it deliberately) ... the last thing you probably want to do is start from scratch even with the things that you've already found work for you. Been there, done that, and trust me: It is decidedly NOT fun!