The point of:
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
Which should rather be:
SCRIPT_DIR=$(
CDPATH= cd -P -- "$(dirname -- "$BASH_SOURCE")" && pwd
)
Is that it gives you an absolute path (and with -P, the canonical absolute path, the realpath()), while $BASH_SOURCE ($var is short for ${var[0]} in bash like in ksh) may very well be a relative path such as ../file.bash.
Without -P, in the case of ../file.bash, cd .. may very well take you to a different directory from the one the script lays as by default (again like in ksh which introduced the (mis)feature) cd does a logical traversal where cd .. doesn't chdir("..") but rather chdir(dirname($PWD)) (and $PWD will have symlink components if you have cd'ed into paths with symlink components earlier).
We set CDPATH to the empty string (which as far as cd is concerned is equivalent to unsetting it), in case it's set to something else because for instance, there's a variable with that name in the environment, as otherwise a cd with a relative path (as in the BASH_SOURCE=dir/file.bash case) could take you some place else. It may be a good idea to unset CDPATH globally, but if that script is intended to be sourced, it may not be acceptable.
Note that it still doesn't work properly if the dirname of BASH_SOURCE or its realpath end in newline characters (as command substitution strips all the trailing newline characters, not just the one added by dirname/pwd for output), or if $BASH_SOURCE is -/file for instance (as cd - is short for cd -- "$OLDPWD").
Addressing the latter and more generally having a cd closer to the chdir() found in non-shell programming languages could be done with a helper function using the POSIX recommendation:
chdir() case $1 in
(/*) cd -P "$1";;
('') echo>&2 'Directory is an empty string'; return 1;;
( *) CDPATH= cd -P "./$1";;
esac
Where prefixing relative paths with ./ avoids the need for -- and addresses the - issue as ./- contrary to - is not interpreted as the previous directory. See there for why the empty string is treated specially. That ./ prefix also disables CDPATH handling so that CDPATH= above is not needed other than as a reminder that that chdir helper disables CDPATH handling.
In zsh, you'd do just:
SCRIPT_DIR=$0:h:P
Or:
SCRIPT_DIR=$0:P:h
Where :P gives you the realpath() and :h the head (dirname, like in csh).
Both won't necessarily give you the same result if $0 happens to be a symlink itself.
Those don't have any of the issues of the bash approach above.