It sounds like maybe what you want is to have the "shuffle" mode play songs close to truly randomly while still penalizing songs that have been played too much recently. This gives us an optimization problem:
minimize KL(π || uniform) - β E_π[times played already],
where β is an inverse temperature determining how much you dislike repetition and π is your policy. Here I've arbitrarily chosen a reverse KL divergence because it leads to a nicer closed form: π(song) ∝ exp(-β⋅"times song played already").
I wonder if anyone has implemented this before in a music playlist.uhm this is exponential backoff
Easy version: Make a smart playlist whose criteria are 'last played is not in the last 3 weeks, last skipped is not in the last 3 weeks'. Randomize within that. Possibly add some other conditions like 'genre is not podcast'. I've been having iTunes/Music.app do this for... probably at least a decade, at this point, it doesn't track when you made playlists so this is just guessing.