Basically, you want to do things to disrupt their OODA Loop and delay their entry, essentially buying you time to do what you have to do, be it street gangs or gangs in blue.
Kerodin takes it a step further with some other additional ideas.
Don't forget the simple things you can do to really throw them off.
Door brace. When the thugs try to break down your front door, and fail, you'll be alerted and can strike preemptively while they stand there stacked, if you choose to do so. 7.62x51 or greater works wonders through doors or body armor.
Shatter resistant window film. SOP for militarized uninvited guests is to announce their presence with some flash bang grenades through your windows. They won't easily be able to do so if you make it hard for them. They won't be expecting this one. Once again, you'll be alerted and buy yourself some precious time.
The nice thing about the 2 products above is that they work passively, without your immediate presence required to operate.
Now, if you have time and are at the ready, you can also use some things to slow the home invaders down even further if/when they do manage to get through the front door, even if your rain of lead fails to stop them. Perhaps there are more of them attempting to gain entry through the back door as well?
Ball bearings were mentioned, but I would think caltrops would work better. You can easily make them yourself without welding. Good enough for rubber tires, good enough for rubber soles. Kinda hard to focus with sharp metal objects piercing your feet.
You're limited only by your imagination. Think outside the box. These people are trying to kill you. Don't make it easy for them.