Hi,
The first thing you should do, or have done, is draw out the logical call flows for your application. These call flows should account for all possible inputs, outputs, and failures, as well as your upper and lower limits of the input. Have you done that already?
Once you have that ready to go, then you should start separating your logic into clear distinctive pieces and parts which can act on their own: 1) Greet the caller, 2) Ask for a passcode, 3) Ask for a numeric input, etc.
Once you have done that, then you start to script each one individually, kind of like baby steps.
If you run into a problem on any one individual part, then come back with your questions, and we'll see if we can't sort it out with you.
Good luck and happy learning.
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.