I have no idea how to order an Bot to use Taverns/Shops, but it can be solved with Triggers.
If this is for the selection of a custom game with picking a hero at the Start, you could add all Hero-types into an unit-typ array and then create them after Human-Players picked or after a time expired.
If you want to make Heroes unique you can then use the Player - disable Training/construction action and you'll need an boolean array, to capture the allready picked Hero-types. At creation for bot hero's you need to consider the already pick situation.
Pro Hint - use the Object Editor datafield - "Pointvalue" to give any Hero-Type a Number, will allow more easy determination.
This will allow you more easily to create Random button btw.