Noticed a lot of concern about performance of this mod and most of it seems to be in the belt in/out connections.
You might consider batching the item transfers in/out. Empty lanes on a belt have 4 positions you can insert items at. I did not look too deep into your tick rate, but it looked like item transfers are checked every tick. You could potentially save UPS by ticking less often.
Some values and notes I took for a mod I wrote:
https://github.com/Peppe-KSP/InterfaceChest/blob/master/control.lua#L3
https://github.com/Peppe-KSP/InterfaceChest/blob/master/control.lua#L541
Example on blue belt you could place 4 items and wait/sleep 12 ticks before even attempting to place the next 4. You can check if the farthest away slot is open and do nothing until you can place 4 items.
If you do go to transferring items ever 6-12 ticks you can then also stagger when factories update, so not all update on the same tick and further increase performance.