Just eyeballing the script in that action, it is not quite complete. Changes to a draft made it script are not permanently saved unless the update()
function is called on the draft.
Add this line to very end of the script:
draft.update();
(//cc @kjaymiller)