This entire episode would never have happened if Starfleet had any sort of workplace health and safety policies whatsoever.
That whole time warp sequence at the end feels really tacked on - it has absolutely nothing to do with any of the rest of the plot (apart from the gratuitous disregard for any form of safety oversight). There's a reason for that... which we'll come to another time. (Oh, the irony!)
Transcript
1
Captain's log: Stardate 1704.2. Orbiting Psi 2000, a world about to be ripped apart. Our mission, pick up scientific party, and count number of safety protocol breaches over the next few hours.
Spock: Everyone is dead.
Caption: Environment suits with no neck seal: 1
2
Joe: Ugh, itchy nose. {he scratches his nose simply by reaching under his headgear}
Caption: Glove off: 2
3
Spock: Be certain we expose ourselves to nothing.
Joe: Yes, sir. Ooh, I feel a bit woozy.
Caption: Not reporting exposure: 3. Or possible contamination symptom: 4
4a
Spock: It could have been some form of space madness, Captain.
McCoy: Physically they're fine, Jim.
4b
Joe: Dead!! Six people dead!! Wllaaaahh!!
Kirk: You better get some rest. Go mingle with the crew.
Caption: Psych evaluation? 5 Quarantine? 6
5
Joe: Wllaaaahh!!
SFX: Stab! Stab! {Joe stabs himself with a kitchen knife}
Sulu: Medics!
Riley: Joe!
Caption: Blood spattered crew not reporting to sickbay for checkup: 7
6
Chapel: He's dead, Doctor.
McCoy: The wounds weren't bad. He should be alive.
Kirk: Coincidence?
McCoy: Joe was on the planet, and now he's dead? No, I don't see any connection.
Caption: Not checking it out anyway: 8
7
Spock: The planet is shrinking.
Kirk: Put the ship into a death spiral that requires engine power to get out, rather than a wide orbit we can maintain forever.
Caption: 9
8
Spock: Where's Sulu?
Riley: Have no fear, O'Riley's here!
Spock: Report to sickbay, Mr Riley.
Spock: Security. Mr Riley is headed for Sickbay. See to it he arrives.
Caption: No Security team shows up: 10
9
Sulu: {brandishing a sword at Kirk} Aha! Richelieu, at last!
Caption: Security allows weapons on bridge: 11. Actually, where is Security? 12
10
Kirk: Now what?
Scotty: Riley said you wanted us on the bridge. He's locked himself in Engineering and taken over the ship.
Kirk: Can't we unlock the door? Or override from auxiliary?
Caption: No! 13. And no! 14
11
Scotty: I need 30 minutes to restart the engines.
Kirk: You've got six before we crash.
Scotty: I cannae change the laws of physics!
Caption: But he does anyway! 15
12a
Spock: The controlled implosion worked.
Sulu: My chronometer's running backwards!
Kirk: Time warp!
12b
Spock: We've regressed in time three days. We could go back in time to any planet, any era.
Kirk: We may risk it someday, Mr Spock.
Caption: Oh, really?! 16