Minor comment on mod internals - lua kinda has loop control stuff via goto, e.g:
for _, obj in pairs(global.logistic_signals) do
if not (obj and obj.valid) then goto skip end
...
if not network then goto skip end
...
::skip:: end
Maybe various sub-loops can be split into named subroutines too, so that instead "50 lines of opaque code" there's "do_this_named_thing(well_defined_state_subset)".
Oh, also, don't ever need semicolons in lua, it's not C, Python requiring specific spaces or JS with its weird semicolon-insert rules.
You can remove all semicolons and newlines from it in fact, and it won't care (a = 1 b = nil or 2 print(a+b)
is perfectly valid).
Thought to mention as maybe it'd make editing lua more palatable for you :)