There's a bit more than Alex said (although he just referred to my article - thanks!).
If the code sequence was in the sequence, it appears, "var myVar" will not rise (or rather, raising it will have no effect), because "window.myvar = 150" (moreover, this does not explain why the first example worked, and the second - only in IE)
It seems that the second script is loading (somehow) to the first, but only in IE8. You can simulate switching tag sequences and you will see an undefined warning in all browsers
var myvar; if (false) { myvar = 3; } alert(myvar) window.myvar = 150;
source share