Deadlock between python script evaluation thread and drivers evaluation caused by scene update invoked from ED_screen_set_scene(). Pretty much the same as setting scene current frame with the same solution BPy_{BEGIN,END}_ALLOW_THREADS.