cd is working, but it only affects your script's process, not the shell from which you ran the script. Several approaches have been used to work around this in the past, but the best one right now is probably to use a shell function instead of a separate script, since a shell function will run within your original shell instead of a separate process.
This would be done in your
cd $(zenity --entry --entry-text="input directory name")
If you then start a new shell and run
cdprompt, it should show the zenity prompt and change to the directory you enter as expected.
If you really want the commands to live in a separate file, another option is to
source the file instead of running it:
bash to run the commands in the file within your current process rather than starting a new one. It's normally used to load configuration rather than run programs, but it should work for this as well.