The author addresses this issue by wrapping the script [1] in {} braces:
{ # Prevent execution if this script was only partially downloaded
# installation code here
} # End of wrapping
I'm not sure if this is a bulletproof solution.