A Way to Randomize Pattern Sequencer Playback

Not much thought into this, idea influenced by playing around with the probability command.

If you have 5 patterns for example, select the patterns to randomize.

randomize patterns 1, 3, and 4

  
0  
1 this pattern is playing now  
2  
3 this pattern may play next  
4 this pattern may play next  

…and maybe a toggle to on/off random.

  
0 schedule to play this pattern next, then go back to randomizing 1, 3, 4 or (if I choose to) turn random off and play in sequence or loop this pattern  
1 this pattern is playing now  
2  
3 this pattern may play next  
4 this pattern may play next  

The only thing I can think of that is conflicting is if any pattern is looped, how would randomizing work ?

this could be an idea for a LUA script maybe