Dogs trained for the job are expen$ive,
Compared to what? A serious injury? Dying? One of your family members dying? A lawsuit from injuring a perp? Everything is relative.
...require ongoing training and a knowledgeable handler.
True. But so do guns.
Following through on training for either choices is key.
Being able to find, and ready a gun in the dark, after being woken up from a deep sleep is pretty tough. Again, any dog will help tip the odds in your favor by alerting you before they are busting down your bedroom door.
Also, I thought I read somewhere that most home invasions are committed by more than one person. Truly the odds are not in your favor if this is true. A good dog is huge advantage.