Run your script and then press F2 for the command history, you should be able to see where the problem is, if there is a problem you would probably see something like 'invalid command' or some other error message before the script tries to go onto the next command or input from your script. (a script won't stop at an error it just tries to blindly continue on so you need to look for the first error) then it is just a question of fix the error and try again.
If you are not sure then run the script then copy your coomand history and post it here.