It seem like it might be a lot more challenging to tell the good guys from the bad guys in a college town, where the good guys may be rowdy and drunk without intending any harm.
A good guy sober can easily be a bad guy drunk. Only a couple years out of college (Texas Tech no less; not much to do in that town but drink), I can tell you about plenty of Jekyll and Hyde transformations after five Jack and Cokes. A fine upstanding guy gets pissed off about work or school or another guy or a girlfriend, and his friends take him out to drink it out of his mind. Trust me, it never works. You now have a pissed drunk guy on your hands. When he wakes up in the morning he'll be the most apologetic man on the planet (especially if he's doing so from inside the drunk tank), but that doesn't erase what he did or could have done while he was out of his mind drunk and angry. You cannot really know someone's intentions when they're drunk, as facial expressions, speech, minor muscle control and other "body language" signs you would otherwise use go out the window. Either of those two encounters, if the alcohol-soaked mind of the person storming in had taken them in what could be perceived as a violent turn, could have ended with a call to the coroner's office. OP was wrong to lock his door, but would have had sufficient cause to pull the trigger if either person storming in had done anything other than what they did.
Lock your door. That way they have to KNOCK first. Then you can ask, "who is it?" They can tell you. You can tell them to go away. No need to use your gun. Yay!
In 100% of situations, good idea. In 99% of situations, you won't need your gun; when the first person, looking for girlfriend, knocks on the door and you in a man's voice asks who it is, alarm bells immediately go off in their head. "My chick's f***ing someone else!". Having the door locked is definitely a good thing even in that case, but you will most definitely have to use your gun because he's coming in to make you pay for the p***y.