I have also had troubles with the editor. When you get an error and VB opens the edit box it seems to be called 'hiddenscript' if you edit there and save it it does not put that code back into the button script. Always simply take note of the error, then close that box and re-open the edit with the menu item to edit button script.
Note also that you should do the 'Save current screen layout' after every edit. Vb has a maddening habit of crashing Mach after several minutes editing VB code. I have had this happen many times while working on wizards, I suspect it some kind of memory leak problem, but it seems if you use the edit button script enough times in one session it will eventually crash.
I always select, copy, then paste my code into a text file. That also helps create a documentation file you can print.