Yeah, I can't go with, "It's none of my business; I'll do nothing and walk on by." I know too many women who've been raped.
Since it was asked, "Did I do right/wrong?" I'll say this about having a gun in that situation:
As you describe it, you were in a college drinking party, and had had a few drinks, yourself. That's a very bad kind of situation into which to mix your gun. Things have a way of getting highly stupid in such a situation, i.e. the gun carrier has a few, gets to thinking all tough-man and decides to show off his gun among his "buddies." Now one of them wants to HOLD it, but he's drunk, and the carrier is not fully sober either so he can't detect how badly this other guy should not be put in charge of a firearm...
Or how about a brawl breaks out in the dorm, and suddenly you're in a room into which a fight between four guys spills. Maybe someone even starts to fight with you. You may be forced to use a gun in a situation you never should have had one in, a situation that doesn't warrant its use and will get you into all sorts of trouble, not to mention the person(s) you might have to shoot.
As far as attacking the rapist, yeah, I think you did right. If you'd had a knife, and decided to take it out as you approached him, you'd have had to use it on him. That could have been really bad. What if this is her boyfriend, and after you knife him really bad, maybe to death, she decides that his behavior was not really rape, was not really even serious (maybe he's beat on her so long that she accepts it) and now you're defending your actions against a rapist who "wasn't really a rapist."
The girlfriend's mind can change drastically once she sees him on a slab in the morgue, and suddenly she doesn't view you as much of a hero anymore. Heck, even a girl who was being raped by a stranger might feel weird about taking your side if you kill the guy. Can't say that I really know what is best to do in 100% of such situations. Sometimes you just have to roll the dice.
But the situation you described is the kind that is usually said to be an inappropriate place to have a gun. Any time you get to drinking, you should seriously consider whether you should have a gun on you. In some places it might even been expressly illegal to drink with a gun on you -- not just illegal to have a gun where alcohol is served. I know it's at least against the rules of gun safety.
-blackmind