This looked both fun and useful, so I wrote a quick little script to do it. There’s no error-checking in here to speak of, so use it at your own risk, but it should work fine if you set everything up the way the script expects.
The script requires you to set up a comp for it to work in. You should set the duration of the comp to be the total duration you want the final output to be. Next, add one each of all the elements (footage, comps, whatever) as layers in the working comp. Right-click one of the column headers in the timeline, then choose Columns… and make sure that the Comments column is visible.
In the Comments column, you can put any integer as the “weight.” This will govern how often you want that particular layer to appear in the final. The default weight is 1, so if you want something to appear twice as often as the default, put a 2. If you want something to appear three times as often, put a 3.
If you things to appear fractionally more often, you’ll have to do a little math yourself. For example, if you have three layers and you want one of them to appear only 20% more often than the other two, you’d weight the two layers 5 and the third layer 6.
Once you’ve completed that, with your working comp as the active item with focus in Ae, run the script.
The script will read the weights for each layer in your comp, and duplicate that layer that number of times, multiplied by the number of complete sets necessary to hit the target length. Next, it will randomize the layer order. Finally, it will prune any layers that begin after the comp ends.
I hope this can be at least a little educational — let me know if you have any questions!