Random Pick
Well, are you using food to limit the hero purchase at the tavern?
1. Have all your hero types for that team stored in a Unit Type array
2. When any player types -random, take away the food/money and create 1 random number from your hero array for that player.
3. If prefered, make that unit unavailable now.
Unit - Create 1 Unit_Array(random number between 1 and 10) for (triggering player) at <point> facing default building degrees.
Repick Function
If your using food or whatever to keep tabs on the heros, make a trigger when any player types -repick
1. Pick all units owned by (triggering player) matching condition
(condition = unit is a hero) and do remove unit from the game
2. Again if prefered, make that picked unit available again before removing it.
3. Add the food or whatever back on, so they can pick again.
Now, if your only limiting players to one hero, then you don't have to worry about the food and all. Most DOTA maps use food to restrict how many heros a player can pick.