one way, to defend a base is building structures like rocket or laser defence...
i would like two different other ways:
installing security cameras in any structure (some kind of main base improvement)
it makes all alien movement in the base visible! i find it some kind of weird, when aliens enter your home base und you have to search for them!
you should be able to research "better base defence" and after this, when you have the mission to defend your base, you see the aliens all the time, they can't hide!
the other way: install selffiring turrets (like for example in a tower defense game). they have no time units and cannot be controlled by players. but they have a reaction fire and can be equiped with any weapon a soldier can carry. so you can have save corridors, when aliens want to move through the secured corridor is a chance they trigger the turrets reaction fire.
(sorry my english is not so good, i hope you know what i am trying to say