Plenty of spells in 3.5 have random effects based on a die roll; they’re just designed with a number of possibilities that maps neatly onto a die (often a d8, for a reason that’s about to become clear). For example, see prismatic spray, or really any of the spells with “prism” in the name (hence the tendency to use a d8, with seven options matching the colors of the rainbow, and a roll of 8 getting you the ability to roll twice).
But to truly allow for arbitrary-sized sets, the answer is to not use dice at all. Instead, what you want are cards. The crusader from Tome of Battle uses this approach, and Wizards of the Coast published maneuver cards on their website that you could print out. The crusader gets to “ready” a certain number of maneuvers, but only a subset of these is “granted” at a time, while the rest are “withheld.” To determine which were granted and which were withheld, cards with the names (and, potentially, the entire description) of the readied maneuvers are shuffled in a deck, and you draw cards equal to the number of granted maneuvers. For the crusader, additional maneuvers were granted each turn, so he kept drawing cards, until the deck was empty, at which point all the cards were re-shuffled (“recovering” the manuevers) and a new set of granted maneuvers were drawn, repeating the process.
This worked extremely well for the crusader. Part of its success, however, is that the crusader could control the “deck” that the cards were drawn from, because he could choose which maneuvers to ready, and also that in the worst case he still had 40% of his options available, and the remaining 60% would become available over the next few rounds so nothing was “missed.” This dramatically improved the play of the class; it’s one of my favorites.
A wild-magic sorcerer could be made along similar lines, potentially. The exact details of doing so well would take quite a bit of careful thought, a bit of mathematical modeling, and quite a bit of testing to get right, but I could see it working.
On a complete tangent, 5e is widely lauded as being much simpler to learn and play than earlier editions of D&D. As it turns out, 3.5e is actually an extremely complicated, well, mess. And I say this as a pretty big fan of 3.5e that plays the system and/or its spin-off Pathfinder almost exclusively.