I thought this line looked out of place when I looked last week!  The redefinition after an if statement that defines SCRIPT_FILE was weird.  Let readlink do the work!