Scope management: delay flag should be per scope, closing a scope should recursively its parent if it is marked delayed