• can't see where this would be a good idea in a production environment

    Oh, YES, if you pay for leased production space and/or you know your db is not growing, there is a threshold that you keep spending and usage in balance. Defrag after shrink when needed. Your company can save money to pay your bonus.

    Why uses a script, same reason commercial-jets are using auto-pilot. This automate some tasks when you want and where you want, without having to logon in the middle of weekend night. It is called DBA Automation. (beats outsourcing)