I have not tried this, but you could use the
M84 S0 command, this prevents the motors to go into an idle state.
M84 G-code wiki (firmware specific!):
On Marlin, Repetier and RepRapFirmware, M84 can also be used to
configure or disable the idle timeout. For example,
M84 S10 will
idle the stepper motors after 10 seconds of inactivity.
M84 S0 will
disable idle timeout; steppers will remain powered up regardless of
What rests is to implement this command into your G-code file to be executed during pause. Depending on the pause method you could introduce this command. I have not tried this, but you could put the command in your start G-code and test if the motors keep powered!
Furthermore, a specific filament change command is available for specific firmware applications. This code,
M600, can be used to change filament. From the Marlin documentation you can read (since you are using Marlin Firmware, you could use this G-code command):
M600 command initiates the filament change procedure. The basic
procedure will move the print head away from the print, eject the
filament, wait for new filament to be inserted and the user to
confirm, load and prime the filament, and continue with the print.
M600 may be initiated automatically if a filament runout sensor is
Please do note that in Marlin Firmware the
M600 command is only available when the comments before
//#define ADVANCED_PAUSE_FEATURE in the advanced configuration options file Configuration_adv.h are removed, hereby activating the command.