I use a script to publish as well. What I shared was just a piece from the end of my script. We have been publishing this way for a couple of years. Works great. It takes a while to set up, but is well worth it in the end. Our GIS analysts use python toolboxes we developed to publish/update services on our test server. After some initial testing, the GIS manager uses other tools in the same toolset to migrate the changes to production. Everything is validated and logged, which make tracking down bugs pretty easy.