A couple ways off the top of my head--create the trials in such a way that you explicitly call the stimuli from the different groups, and then randomize the order of those trials using WGR values. This will give you a fixed number of each group combination.
Or for a truly random alternative---for any given trial, you could create 12 identical versions where only the groups of stimuli differ. Then assign the same WGR value to each of those 12 trials so that the first one presented will be randomly determined. Then, no matter which of the 12 trials occurs first, have it skip over the remaining 11 to the next.
Any of that make sense?