That's because when you run a script from terminal, this doesn't run in the current shell terminal, but in a subshell. The variables, functions and aliases created in this subshell are only known to the particular bash session of that subshell. When that shell exits and the parent regains control, everything is cleaned up and all changes to the state of the shell made by the script, are forgotten.
To prevent this, you can source the script in the current shell terminal, using the following command:
. Script.sh #dot, space and the path to the script
Script.sh should look like:
source /path/to/SetEnv #if you want that your script to know about 'SetEnv' function.
More about: http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html.