I have a similar situation with multiple mills serviced by a Top Loader. Each mill can be offline at any time and we want the system to utilize each mill equally. My solution is pretty long but it has worked well for several years. It is based on using registers for each machine that increment each time a part is loaded into a machine (balance count register). All the registers increment whenever a part is loaded and the count is reset for the mill that was loaded. I also have a priority register that can be set to a specific mill if I want to load that mill next.
The main program calls a sub program that looks to see which machines are online and ready and then sets/resets bits based on that status for each mill. Then it looks to see if the priority register is set to a specific mill and then if yes, it sets the "balance" register to the priority number and exits that program. If no priority, it looks to see which mill has the highest count and then sets the balance register to that mill and exits the program. The main program then calls the mill program based on the value of the balance register. The balance count for that mill is then set to zero.
This allows any mill to be offline for any period of time and then come back online and the robot can load it immediately if the count is the highest because the count has been incrementing each time a part was loaded into any machine. It will cycle through all the machines before going back to the same machine again.