It would certainly maker it much harder for anyone -either terrorist or drunken git -to force their way into the flight deck, but if it fell into the bad guys hands it would not allow them to fend off 100 plus passengers for long.
You might as well GIVE the stun gun to the hijacker/drunk. One needs to actually TOUCH the assailant with the stun gun. While sitting strapped in your seat with the yoke between your legs, reach behind you and try to touch a guy thats standing up behind you. He will merely back up out of the way until he can grab your wrist. Your arm WILL be broken as soon as he gets hold of your wrist, and hyperextends it around the seat back. He has all of the advantage by standing behind you. If you give it to him, then MAYBE your arm won't get broken before you are shocked with it. ..... Stun guns are worse than nothing at all.......