Documentation? Not that I'm aware of, no.
Just create a dummy smartlist and play with it. Use simple examples that produce results you can easily predict to test if you have the right grasp on it. Something like:
[media type]=audio ~n=20 ~%=50
Which returns 10 tracks, as you'd expect. Take the help file example (it's not 100% correct); if you simply typed "Bob Dylan" into the search field, you'd get all tracks with Bob Dylan in any field
that's searched by default. Adding the ~%=50 modifier discards half of the the results. In my experience, it's always the top half of the list that is retained.
So, for your ~mix rule:
~mix takes each search in its own right. In the background, it gets the list for each search, picks the specified number of files randomly from each list, and finally shuffles them together to give you your ~mix result.
{r=5 ~sort=[Last Played]-d} and {r=5 ~sort=[Last Played] ~n=20}
The files returned by the second search will also feature in the first search, which could mean you get unwanted duplicates, and as we know that the files from the second search will be at the bottom of the list returned by the first, we can make sure they are excluded by adding the % modifier.
Now, I went for 50% because I was unsure how many 5 rated tracks you actually have. We are only concerned with excluding those 20 files returned by the second search, so, if you are worried that 50% is a little too much, try perhaps 75, or 80%. Perhaps work out what percentage of your 5 rated tracks those 20 files represent and use that figure instead...
play around with it to see how it works. have fun
-marko.