The ruling followed a procedurally fraught stretch in which the state repeatedly sought additional time and drew open judicial criticism.