Interesting question! My first thought was I'd rather have a taser because I don't think I could ever shoot a gun at someone for fear of killing them. However, with a gun you don't have to get very close to the person, so there is definitely an advantage there. Also, if the intruder knew you had a gun, he might stop in fear of being shot, whereas with a taser, he would stand a better chance of running away unharmed.
Oh, new thought just came to me. If all I had was a taser and he had a gun, it would not be a good position to be in, would it?