I have made some additions using macros after reading other blogs, but am still not able to get proper randomization where the deviant stimuli does not repeat itself.
I am attaching the revised version with macros too.

The macros feature in SuperLab 4.5 was completely rewritten from scratch and was replaced by the rules features in SuperLab 5. Rules are much simpler to use and more powerful at the same time.

While we still support SuperLab 4.5, this support is limited to features that are common to both versions. But for something that was replaced and made better over four years ago, I’m afraid that we cannot devote precious support resources for that.

I apologize for the inconvenience. We’ll be happy to assist if you get version 5.