You question yourself how you can execute your own logic while basalt is also active? There are multiple ways of doing that:
Number 1:
Using parallel.waitForAll
You can read here what exactly parallel.waitForAll() does
Number 2:
Using threads
Number 3:
Using timers