No, WarCraft III has very poor support for interacting with player GUIs.
You can detect idle units programaticly by polling units that have no current order. Be careful as polling is rather resource intensive and could easilly cause performance to degrade if there are any leaks in the script, if the period is too high or if the unit scope is too large.