Instead of using the z script, why not just use cd and $CDPATH, which are built in? I have mine set to this:
export CDPATH=.:$HOME:$HOME/workspace:$HOME/gocode/src/github.com/geetarista
You can set it to whatever you want, then just use `cd` and not worry about using some other script.