The set command creates a global variable. The var command creates a local variable. Local variables can also be created using the -l switch in the set command.
Local variables only stay for a period of time -- usually until the script ends -- however, I have come across times when a local variable has been unset before the script ended, especially when it's been a big script (ie: 25k+)

Global variables don't get unset until you unset them (or reset them).

None of this counteracts my earlier statement about using proper variable names.