The important things are:
1) it's a text file that cointains a sequence of shell commands (like on the command line), one for each line. [1]
2) it should be executable (that's what the chmod +x !@#$ does), otherwise you can't execute it directly
3) the #!/bin/bash on the first line is nice, but not necessary
4) don't torture yourself with vi (or emacs, or ed) unless you are already comfortable with it
ETA: [1] this is a "lie to the children" - commands can span multiple lines, and there can be multiple commands on a single line, and there are subtle differences between putting something on a command line and putting it in a shell script; but the general idea is a good starting point