I revised it slightly to be more efficient by not reloading your whole .vimrc and only changing the background setting when it hasn't already been set to the desired value.
@aaronbieber Thanks! The only issue, though, is that it does not have an existing background value work with and thus, launches with the Dark background by default. If it's daytime, it won't be until you save the file that it will change to Light. I've updated my gist to combine yours in a way that works, although, a bit repetitively.
Instead of repeating the logic that is already in the function, replace your second section (starting "Launch vim with light background...") to just call SetSolarizedBackground().
Always be DRY (Don't Repeat Yourself).
@aaronbieber Ah, didn't think about that. Fixed. Thanks!