Move `sleep()` call to prevent race issue

The code runner checks if there is an `editor_running_path` variable. If
it's not found, the runner exits (as the file is deleted when the editor
stop running). Unfortunately, if the runner starts first, it instantly
exits. Moving the `sleep()` call to the beginning of the loop, we give
it the time needed for the file to be created by the editor process.