[Request] Disable and re-enable movement at will

Would it be possible to have a script that prevents the player moving with the arrow keys or a mouse button press until the script is disabled? (It needs to be repeatedly enableable and disablable)

However, the player should still be moved if a move route command is run on them, from an external event.

Thanks!
I didn't actually test movement routes, but from the code it should work:

Code:
/*: * @plugindesc <Disable Movement> * @author Iavra * * @param Disable Switch * @desc If the given switch is set to ON, disable all movement by input. * @default 100 */ (function($) {    "use strict";        var _params = $plugins.filter(function(p) { return p.description.contains('<Disable Movement>'); })[0].parameters;    var _param_switchId = parseInt(_params['Disable Switch']) || 0;        var alias_moveByInput = $.prototype.moveByInput;    $.prototype.moveByInput = function() {        $gameSwitches.value(_param_switchId) || alias_moveByInput.call(this);    };})(Game_Player);
Disable movement by setting the given switch to ON.

Original thread: https://forums.rpgmakerweb.com/threads/request-disable-and-re-enable-movement-at-will.54813/