Something like that should definitely not be able to trash the Bangle.js firmware, but it's possible that if there is some issue it could mess up the Storage (but that should be recoverable using the 'reload without loading code' instructions).
I just tried the code you posted here on an up to date Bangle and it seems to work fine for me
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
What firmware version were you using at the time?
Something like that should definitely not be able to trash the Bangle.js firmware, but it's possible that if there is some issue it could mess up the Storage (but that should be recoverable using the 'reload without loading code' instructions).
I just tried the code you posted here on an up to date Bangle and it seems to work fine for me