I would start by thinking about what kind of a villain Vecna is, to inform his signature traits.How would you build Vecna?
- He is known for the power of his eye and hand.
- He's intent on learning and keeping secrets.
- He was defeated by a sword-wielding vampire.
- He's the iconic lich--as far as I know, the first named lich in all of D&D history, and certainly the most well-known, even before Stranger Things.
Then I'd develop other powers around deception and detection. Vecna knows your secrets (e.g., he knows what spells all casters in the party have and what magic items everyone is carrying), but you don't know his. Perhaps he projects quasi-real duplicates of himself, which have his powers but fade into nothing if they take fatal damage. (Multiple duplicates, each with its own initiative, could act as a form of legendary action.) Meanwhile, the real Vecna stays hidden in an adjacent demiplane, laying down occasional debuffs and sending out new duplicates as the old ones are destroyed. To reach the real Vecna, you must locate the point where the demiplane touches the Prime, and then do <something TBD> to force open the entrance and get inside. Spotting where the duplicates are coming from is key to doing this.
The demiplane is filled with a devastating field of necrotic energy which inflicts heavy damage on each PC at the start of their turn, plus a debuff of Vecna's choice. Vecna is vulnerable in melee (for a CR 26 definition of "vulnerable"), so his focus is keeping his enemies at a distance.
As far as spells go, I would follow the general thrust of the Vecna statblock on D&D Beyond: In combat, Vecna relies on custom non-spell powers, but he also has a list of utility spells. I might flesh out that utility spell list a bit more. On the other hand, I would also be much more strict about excluding combat options from it (no lightning bolt or dispel magic, probably not dimension door either). The descriptive text would note that Vecna knows most or all of the spells in the PHB, but he normally devotes most of his prepared spells and slots to empowering his non-spell abilities. This is a thing he can do, because Vecna.