Sadly, i know only AAI controllers.
Except copy-pasting AAI controller blueprints - no idea how to help you.
Orders will eat ups. You have to carefully regulate the tics(per second/per minute) to avoid the script to calculate stuff too often to reduce the ups cost.
The number of active units (event standing still units) itself eats ups, in fact.