If you use queue for tasks you can set "priority" for them. I that task will be off the queue when it is finished and tasks with lower priority will execute after that. (correct me if i am wrong)
"Global variables" things i guess is bad. Setting "busy" state for something in config also sounds bad. Maybe if you can explain a bit more your situtation we can come up with best/better solution.