Unfortunately you can’t detect right click in scratch :(
But you can use the “1” key to quickly switch to eraser if you have a keyboard.