This is going to delete the whole "rudder.autoDeployOnModification=.*" line. You should capture it, and add it again to the final line, like:
+sed -i "s/^\(rudder.autoDeployOnModification=.*\)$/# This variable has been replaced by\n# rudder.workflow.enabled, see below.\n#\1/" rudder-web.properties