I've thought about this and researched it myself, but FYI, it can't be legal.
Even if stun guns are legal in your area. You can't set boobytraps (like a shotgun in your window). Remember the guy who electrified his car in a locked garage some time ago? Or the guy in FL who did the same to his store, narrowly missed manslaughter and that requires someone to break in which is probably why he just slid by.
Putting a hazard like that out in the open you'll be *****ed.
Say someone touches your handle and dies (pacemaker for instance) or a child does it, you're going to jail.
If you were to really do it, I'd put it somewhere inside the car. For instance, on mine, to get at whatever is in the doubledin, you have to reach under and inside the dash.
It's the natural place to grip and can't be hit accidentily. Perfect place.
BTW, here's another link on the subject.