Situation like that will always equal a bad day. Close quarters like that I would fight/shout with all my heart while trying to make it to my knife. Long gun too clumsy for such contact ranges and the mad dash to my roomate's room would probally only end up with both of us being occupied with at least 1BG able to attempt to aquire another weapon. Since they are out in the open. Especially considering the roommate was asleep when all this started.
Organized attack like that, you have to assume your dead if you dont kill them first. Especially in broad daylight. Either go after the shotgun guy first or keep his buddies between you and him.
However, the best strat I can think of is to answer the door armed. Not trying to be picky but bloodstains in your carpet probally will loose you your security deposit, so why not be ready to shoot the ******** in the hall?
I am trying ot get my wife in the habit of answering the door while armed, she is not used to thinking about such things/having a weapon she could use. Especially important for her because the peep hole is about 8 inches too high for her to use (yes she is that short) Don't really blame you for going unarmed to the door, glad you have learned the lesson though.