About the requirements and "single document":
Those tasks that I use bash for are usually one-offs, and live on the server they are used on.
Thus, it should be easy for the next admin/Dev to find it and understand/fix/extend it.
Of course, if there is a more advanced task those requirements fall short and there should be a proper Dev env with source control, tests, etc.