Sadly this method doesn´t work for my Prusa i3 mk2 since there is no mechanism allowing to change the filament by hand without any trouble. I've always done it over the menu. But if I use your code, I can't get in the menu, because if I click on the menu button, it automatically continues printing without letting me change filament.
So what I need is, that it moves the extruder away (as it does now) and pauses the print and I have to resume the print by the menu after changing the filament. Also a signal sound would be nice, if possible (my printer is able to do that).
How could I do that? Do you have any advice? It would be really nice! Thank you