Q:

Sci Fi Capital Punishment Story With Execution by Apartment Deathtrap

I'm looking for a short story that I read in Grade 8 (2000-2001), but have been unable to find online. 
The details:

The primary theme of this story is the morality of capital punishment
The story deals with a future society that puts people into a deadly apartment while their trial takes place, they sit and wait for judgement, unconnected to the trial or the outside world
The apartment has something in it that kills the person when they're found guilty
The protagonist is found NOT GUILTY in the end, however when they go to open the door to leave, it's revealed the doorknob has a small needle in it which injects and immediately kills the GUILTY person

Here is what someone else added when I asked on another site:
*I think it's older than that, because I feel I read it in the mid 1980s.  I thought it might have been in 100 Great Science Fiction Short Short Stories, because I was reading a ton of those Asimov/Greenberg/Olander collections around that time, but I had a quick look and couldn't see it. 
From memory, he was actually found guilty, but if he stayed in the room for seven days he was free to go, and the timing on his release was out? 
Possibly that anthology also had "Now Inhale" by Eric Frank Russell
If that rings a bell the anthology would be TV:2000.  If not, I might be leading you down the wrong path.* 
I would really appreciate if someone could help me out with this one, it's bugging me! 

A:

This appears to be "In The Hereafter Hilton" by Bob Shaw, first appearing in Omni Magazine in 1980, although if you read it in a collection of stories by multiple authors it was probably in "The Best of Omni Science Fiction No.  5"
It begins with the main character, Renfrew, being installed into the apartment:

The apartment was neat, stylish, and comfortable— not at all like a machine designed for killing people. 
For a few seconds after the entrance door had locked itself behind him, Renfrew stood perfectly still, taking stock of the place, trying to identify the most likely sources of death, The kitchen — always the most complicated room in any habitat — was one area that obviously had to be avoided- Every particle of food and drop of liquid was suspect in case poisons had been administered; the appliances could have been wired in such a way as to electrocute the unwary user, and the bright-lettered canisters could be bombs that would explode on removal of their lids.  Even the simple act of opening a cupboard door might release a cloud of instant-acting gas

And of course, ends how you remember:

The breath left his body in a noisy, quavering sob He pushed a hank of hair away from his forehead, as if giving himself a better view of the glowing words might change their import.  The message remained the same.  He was a free man! 
Renfrew got to his feet, suddenly conscious of how much he had been dreading the ordeal that had lain ahead.  He took a last look at the apartment, gave a low chuckle of relief, then strode to the door with a buoyant tread, keyed up for his first taste of liberty in many months. 
The doorknob did not turn when he grasped it. 
Instead it fired a cloud of poison through the skin of Renfrew's palm, a poison so swift-acting that he had no time to realize he had been tricked by executioners who, in their determination to be humane, were not above telling a little white lie. 

You can read the full story here.