Updated postflight write_script to accept config dict when saving a job