Under normal use, the flash (archive) cannot be edited. While the OS has access to the functions and privileges to write to flash, it requires some very specific exploits to unlock it for user use. The possibility of accidentally unlocking flash is astronomically low.
So in other words, you may erase RAM frequently, Flash+RAM (very infrequently, even when I was putting in semi-random stuff I never had the problem), and I think that unless you somehow unlock flash, it's impossible to brick your calc with code.