1) Categorize the "buying units" off each team differently, then have the "Select Unit" ability to only have the desired targets.
2)Trigger:
- Player Group - Pick every player in (All players) and do (Actions)
- Loop - Actions
- Player - Make (Unit-type of (Sold unit)) Unavailable for training/construction by (Picked player)