Oh, your idea is to make a widget to show the connection speed. I actually don't know about it never use the init network traffic before.
It is one of the neat way to get the network speed without installing additional network monitor. (why waste space for something that we can create in Automagic)
I don't have the need, as I have Xposed + GravityBox to show the connection speed already in the status bar. Thus never make effort to make it
As usual, I have seen your flow, can't help not to give suggestion.

I am sorry first because I am going to comment a lot.
The initialization of the divider and timeout doesn't need to be protected, you can just init as
divider = 1000;
You have 4 elements in the loop. Actually you only need 2.
I almost never use sleep action outside of script anymore, unless the consecutive elements are not one of the script, expression, or Control UI.
You can simply replace the sleep timeout, into a single line script, sleep(timeout*1000), removing the sleep.
Next is you don't need two init element. As you can see, without the script, both init are back to back.. You can just save them to another var temporary. Of course you have to init it first at the script before, by set it to zero.
This way, the first you start the flow, it will show a very huge number. But afterward it will be normal. I don't think it will be annoying, as only the first number affected.
AEP number can be set to a very high number. But I suggest you increase it sparely. You don't know one day you have the run away flow and it drains your battery because the AEP is too high and Automagic doesn't stop it.
There are several startup elements. Then you have 4 elements in loop, with maximum speed 1 loop/second. So total 4x60 = 240 elements execution per minute. You can set the AEP to 250, or 300 for safety.
If you have optimize to only 2 elements per loop, you only need 120, or can be set to 150 for safety. Or you can actually update the widget twice (the maximum refresh rate), by setting the sleep to 500 ms only. Thus you still have 240 elements execution perminute. By optimizing the flow, you can have a higher refresh rate using the same AEP number.