I would just like to add that there is also the fifth level
Geas spell that can perform the long term co-opting of a person's will the the OP seems to want.
Dominate Person gives more complete control, but the duration is limited for a "sleeper agent" type scenario.
I would like to point at that, though it was a necessary nerf--
for PC magic, to tone down the charm type spells, that is not necessarily the case for NPC/Monster abilities. As long the CR is taken into account for this ability, it is perfectly okay for monsters to have abilities that PCs don't, as they are built with a different purpose and with slightly different rules than PCs. As long as you keep in mind
@5ekyu 's wise advice about using it on PC's too early in the level progression, it could be perfectly alright. It could be fine for some obscure ritual (unavailable to PCs) to be used on a captured NPC by the demon cult to turn them into a willing minion, but becomes more tricky to use against PCs. Not to mention several monster abilities that just outright offers long term domination (see aboleth enslave ability).
One of the problems with PC spells in particular is that they have to balanced against using them on PCs in addition to the PCs employing them against monsters. That is one of the reasons spells like the
Power Word line are so lackluster for PCs, they are deadly when turned against the party.