Could you add a function similar to os.wait that doesn't require a callback? It would make programming a lot easier since I would be able to make it release control back to factorio inline with my code, rather than doing weird functions with callbacks. for example:
while(n<10) do
term.write(n)
n += 1
os.sleep(1)
end
would increment n and print it once per second, instead of your loop example that does a similar thing
reading your code, it looks like the sleep function depends on callbacks because of the way on_tick works.. hopefully there's a way to do it without, I'm not sure