The scenario is as follows - an 8th level Wizard, Dormouse Bladefist, has a cave mouth he wants to defend at all costs. He has some money and magic materials, and can probably craft some weaker magic items. As a wizard, he has his spellbook, and can reasonably copy any other spells into it accessed through his Wizard's Guild that he currently lacks. He has access to labour from a local village, and the services of 7 Goblins, 3 Bugbears, and a Bulette who are relatively loyal to his cause.
Some old fortifications litter the cave mouth, but will not serve his purposes as they are old, broken, and mostly inside the cave.
He has time to prepare - several seasons, perhaps years, before enemies come to try to gain access to the cave mouth. He has no knowledge of what kind of enemies will seek entrance, but is determined to do his best to prepare for whatever he can.
Which printed spells or magic items would best assist him in this endeavour? I am specifically looking for long-lasting spells, ritual spells, magic items that would be especially useful in defending a static structure, what magical traps if any an 8th level Wizard could conceivably craft. Spells, items, traps, that would be especially efficacious in defense of a static location, rather than just powerful in general or otherwise, to give the impression of an intelligent man who has put some thought into what arcane defenses he can muster and been given the time to muster them.