The Joker really didn't care about death at any point even if Harvey pulled that trigger then. The biggest example for that is during the scene when he falls of the building during the fight with Batman even when he is falling, he laughs hysterically before Batman catches him with grapple gun.
Harvey Dent was Joker's biggest ace. When he gave him the gun he took the gamble, had Harvey blown Joker's brain then the Joker wouldn't have cared about his death but he surely would've had the last laugh because he took the symbol (white knight) of the city and drove him to insanity and made him a killer. The Joker's primary ambition was to make Batman do that but Batman was completely incorruptible so he resorted to the next best person in Gotham city which happened to be Harvey Dent.
Even Joker openly admits that in the above mentioned scene to batman.
Batman: This city just showed you that it's full of people ready to believe in good.
Joker: Until their spirit breaks completely. Until they get a good look at the real Harvey Dent, huh? And all the heroic things he's done. You didn't think I'd risk losing the battle for Gotham's soul in a fist-fight with you? No, you need an ace in the hole; mine's Harvey.
Batman: What did you do?
Joker: I took Gotham's White Knight and brought him down to our level. It wasn't hard. See, madness, as you know, is like gravity: all it takes is a little push. (Laughter)
I have been thinking about this question furthermore. I believe the only reason Joker walked out of the room alive in the hospital scene with Harvey Dent was because the coin toss favored him. As we learn later in further scenes Harvey only shot the people whom the coin toss didn't favor which included Batman as well.