Does it have to be a physical altercation?
Common misconception is that the main villain has to be able to fight the party physically. This is simply not true and in my opinion comes from the video game mentality. You easily enough have the end villain be a child or physically weak individual with a few abilities that make him very influential.
Example villains from stories and movies:
- Leader from Marvel Comics
- Thulsa Doom from Conan the Barbarian 1982 (although even in the book he was a competent fighter but, his main henchman was far better, his power came from the zealots he influenced. Even the last "battle" wasn't even with him.)
- The Penguin from DC
- There was a kid from the old Flash series from the 1980s that made toys.
What all of the above have in common is that they used minions and influence effectively to thwart the PCs and fled when the fight went against them. Recurring villains have that in common, they know when to run and fight another day.
NPCs can be built the same as PCs they just are not due to bookkeeping and preparation times. They have custom abilities that come close to class abilities the PCs would get but are more or less powerful and simplified for bookkeeping. Don't get too bogged down with the numbers in general and build the personality first. Write his abilities to balance against your desired CR from the DMG and flesh out abilities that enhance that personality and allowed him to get into that position of power and influence.
I would like to add that a commonly missed detail is that any treasure rolled for a monster/NPC intelligent enough to use it would do sobe used by it. So if this is, in fact, a caster of some sort and their hordehoard included a wand, he would likely have it equipped and use it to maximum effect during any encounter. Barring any monologue of course.