You know that it's all in triggers. You can make at map int all heroes to a variable with numbers. Like, variable called RandomHero 1 is ranger, RandomHero 2 is priest...
Then, on map int again, wait few seconds, then for each computer, give him RandomHero "random number between 1 and X", where X is maximum number of heroes. That way, a bot has selected a random Hero, then you can easly make action "Game - Display to all players the text: Bot picked (last created unit)". For going down, mid, and top, make like, Bots 2.,3. go down, 3.,4. go top and 5.,go mid. Simply, pick every unit owned by the player, and move him to desired spot whenever you want it. It would be best if you make it on "sound" similar to dota. Then, Hero will freely move. For low health to go back, when unit is attacked, simply detect his health, like if it is less than or equal to 25%, then order him to move back to fountain. Learning spells and such are a bit complicated. When the hero levels up, learn him spell. And then, if it's attacked, or if it attacks is better, simply order unit to cast the spell. Note, to cast a spell by triggers, you must cast a spell MADE from the one you are using. For example, you have a spell called Raise Dead, and you rename it to Summon Skeletons, you will have to cast a spell called Raise Dead, because there will be no such spell to cast as Summon Skeletons. You will have to do it for every Hero, I think that there's no other way. Buying items is similar, if player has X gold, and if the hero is near the shop, reduce the amount of gold for the player, and create new item for the Hero.