A Superior Court judge granted a temporary restraining order Thursday that will delay for the fifth time the closure of Dorothea Dix Hospital.