Put the following in your .bashrc instead:
shopt -s autocd
If you type a directory in the command-line, it’ll cd into it, e.g.: $ .. # cd ..
$ ~ # cd ~
$ foo # cd foo
I can’t live without this.