I only collect a reward prior to starting the task. I check slots one by one. See if it is running, completed or free. If it's completed I pick up reward and start new task on it. If it's free I start new task on it and if it's running I skip to next. I also always check the slot again to see if the task actually started, to safeguard against some gateway glitches that I've noticed.
I have to check the levels after the collecting the reward step, which if APBU is running for a while and not just starting or relogging due to timeout, is always prior to starting a task. So assuming APBU is running normally it will always check prior to starting a new task in between collecting the reward and starting the task. This will slow it down.
Before you ask, I don't collect all the rewards on one go due to the way I'm safeguarding against a fundamental flaw in Neverwinter's system and that's the inability to select which slot you start the task in. No matter which slot you select the task will always start on the first free one. This can cause issues with tasks starting in the wrong slots and messing up the queues under certain conditions. This is why my logic is isolating slots and processes them one by one, doublechecking every step of the process that it succeeded before proceeding to the next.
And no, I'll only share the source under GPL if I stop working on it

Perhaps you could send me the script in question instead, to see how it does things and if there's any idea I can use. Notice though that I'm working with QtWebkit on C++ and it's not a full blown browser. It uses JavascripCore engine with JIT (I don't rely on JS though, I'm only using a miniscule amount of JS) but several things I've had to implement myself (eg persistent cookie storage for one-time code etc) and some things are done in a very hackish way (eg in order to know when a Gateway page has finished its scripts, because they manipulate the DOM, I'm injecting JS that I tie back to a QObject that's firing a Qt signal). To get an idea of what's possible (without subclassing every high level Qt API) check:
QtWebKit 5.0: QWebElement Class | Documentation | Qt Project
QWebFrame Class Reference | Documentation | Qt Project
QWebPage Class Reference | Documentation | Qt Project
https://qt-project.org/doc/qt-5.0/qt...it-bridge.html