core: refactor sched_run

`sched_run()` was cluttered, changed changed without refactoring a lot.

Rebased on #1836.
An int cannot be `true` (in a literal sense) - and what is returned otherwise?