Couple of things and I'm likely out of my realm regarding hlds_run, completely not being a gamer.
First, the script probably should have no SPACE in the shebang line, change:
Next please clarify. You're saying that you can type in an hlds_run command and it works. And once you do that, you can run your script, and it also works. The issue here is that you open a new terminal, and try to first run the script and it doesn't work, and won't work until you manually type a successful hlds_run command.
To me this is one of two possibilities. One is that you're typing a slightly different command manually than you have in your script. Two is that it's not your script, it's your environment or the game engine or something which requires interactive or something to be set up which ends up getting set up the first time the command gets run manually, and then all is fine following that.