I would try using everything but the execute line (/isort execute retainer) before summoning your retainer, then using that line once the retainer's inventory is open. All of the /isort category commands are just supposed to change the settings, which I wouldn't think would require the window to be open. Still not ideal, but if it does work, it's better than typing the whole thing manually.