What's a double unit?
If you want to prevent two units spawning on the same side consecutively, just alternate between the lanes instead of choosing left or right randomly.
In general though, you can record where the last unit spawned in an instance variable. Check against that instance variable to make sure the next unit doesn't spawn there, then update it.