It looks like to me that you have an issue not with your variable but on how you trigger your pop up. If each tick does not show up in the same order (say they appear based on a learner action), I would add the check for the variable value action to each tick to trigger the pop up if the variable equals four (your item #2).
Two things: on your page, there was no way to process the question. The onload action checks the variable before the question is processed – which works if the learner returns to the page, but not on the initial page load. I added a process question button and it worked fine.