How are you sorting the units you want?
Are you trying to pick all of a particular unit type, or all of a particular unit type owned by a player, or all owned by a player, etc?
Unit Group - Add Unit.
Set TempGroup = (Units owned by Neutral Passive matching (((Triggering unit) is A Hero) Equal to True))
Event
A unit sells a unit
Condition
(Sold unit) is a hero Equal to True
Unit type of (Triggering unit) Equal to YOurTavern
Actions
Unit Group - Add (Sold unit) to YourUnitGroup
Untitled Trigger 001
Events
Player - Player 1 (Red) types a chat message containing -AR as An exact match
Conditions
(AR Timer 0480 <gen> is alive) Equal to True
Actions
Unit - Explode Hero Selector 0178 <gen>
etc
Player Group - Pick every player in (All players matching (((Matching player) slot status) Equal to Is playing)) and do (Actions)
Loop - Actions
Unit - Create 1 (Unit-type of (Random unit from Starters)) for (Picked player) at (Center of (Playable map area)) facing Default building facing degrees