Ummm... I think you can add an array (small 3 by 1) and then store the last three levels as Lvl1,Lvl 2, Lvl 3 then you can code in after the random lvl number that is the lvl number equals any of the past three it re-rolls (You will probably need another mechanism that stores the last lvl then pushes the next two back.)
I'm unfamiliar with using arrays. I'll have to read more on it. I think I get the part of storing the level and re-rolling if it lands on any of the stored numbers. I don't understand how I can "push the next two back." Maybe on start of layout, modify the array?
Is there an easier way? Is it possible do this using variables?