Well, looks like what you have there should work - but you're using Serial1 which is an actual serial port - not USB. Try removing Serial1.setup, and change the next like to USB.on.
You may also need to move the console over to another place so that the data you're sending over USB doesn't get interpreted as JavaScript. You can move it out the way with LoopbackA.setConsole() - but after that you will probably need to reset Espruino with the button before you can reprogram it.
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.
Well, looks like what you have there should work - but you're using Serial1 which is an actual serial port - not USB. Try removing Serial1.setup, and change the next like to USB.on.
You may also need to move the console over to another place so that the data you're sending over USB doesn't get interpreted as JavaScript. You can move it out the way with LoopbackA.setConsole() - but after that you will probably need to reset Espruino with the button before you can reprogram it.