Issue with Scripts
The real issue is not scripts but a lack of a proper life cycle including a rudimentary spec (why are you doing this), peer review, testing, version control, and documentation. Some of the spec and documentation can be in the script itself but should exist. Also, testing as much as possible should be on development system not production. Yes this could add a few hours or days to the development time but scripts are actually small programs and should be treated as a program.