Are you sure you named the file correctly? Check by typing:
Do you see it? Is it spelled correctly?
If not, Did you first create the folder and then the shutdown.sh file?
sudo mkdir scripts
sudo nano shutdown.sh
From here, you are in the file where you put all the text above. Exit and save. Now you are back at the command line. Try this to change permissions:
sudo chown pi shutdown.sh
Now test it out again.