Several of them would wind up getting shot and that would serve as a real lesson learned for the survivors and other would-be home invaders.
Well, first there is the issue of living where this would happen. I'm not keen on cities to begin with, so I tend to try to live closer to more rural areas. Second, there is the issue of a complete lack of situational awareness. Complete strangers, in a group no less, knocking on your door and throwing pebbles against your window is not what I call an everyday event.
Okay, so I'm cautious, and the cityfolk call me paranoid. But unusual events around the property will always see me holstering a .45 ACP pistol, and sometimes unlimbering a 12 ga shotgun loaded with 00 buck. Nothing like the occassional pack of feral dogs around here to get your caution up in a jiffy. On the other hand, almost every home out where I live has firearms, and it is not unusual to hear shots during hunting season.
So I find it highly improbable that I would place myself in that situation to begin with. However, to answer your question in the improbable event that something like this happened at my home: yes, I would shoot, after giving a warning if they give me enough time to issue one. Even if they vastly outnumber me and have firearms of their own; I'm not going down without being absolutely certain that the first of them to raise a hand goes down with me. Mobs turn ugly real fast and at unpredictable moments. I'm not taking any chances in that kind of situation. If someone has the presence of mind to participate in a planned group activity (no matter how loosely planned), they have the capacity to accept the full consequences for their own actions. Age is not a factor; capacity to formulate actions is the key.
In practical terms, I would probably move away after something like this happens. It would might be the kind of event that would trigger the expatriation I have been planning.