What you describe is the standard in some industries. If a research team discovers something new, lawyers will make a patent out of it that is broad / vague enough to prevent any further research in that area by competitors. At the same time they look at the patents of competitors and if they are too specific they try to patent similar ideas.
The difference between the divers and Musk is that the divers did it without announcing their plans on Twitter. They just when there and helped. I think it's good that Musk tried to help, but the publicity he got with it makes me question his motivations.
There is also no need for personal attacks
First make sure that the scripts are in a vcs and if it is possible make sure that someone else looks over them before they are checked in. Often the awesome "DB_backup_script.sh" is not so awesome.
If the scripts are not documented document them, so that others can use them and know their limitations.
One way to allow other users to find scripts is to embed them in a grouped/sorted way into a wiki with instructions on how/when to use them.