I have taken this spell from Pathfinder 2e, where it is a level 7 spell (I think here are 10 levels there though), and converted it into a 5e spell.
I think it is still around the correct power level for a 7th level spell, but just putting this here to get some alternative opinions.
Warp Mind: 7th(?) level enchantment
Casting time: 1 action
Components: I don't care
Effects: Fluff, blah, blah. The target takes 4d6 damage and must make an intelligence saving throw. On a successful save it suffers no additional ill effects and the spell ends. On a failed save it suffers the effects of the confusion spell.
At the end of every 30 days the creature can repeat its saving throw against the spell. If it succeeds the spell ends. The spell can also be ended by a greater restoration, heal or a wish.
This spell is a bit like Feeblemind deliberately, but has a clearly less harmful effect. Therefore it should be lower level than Feeblemind, which means 7 or lower.
I don't think there are any other similar spells in terms of length of effect, and while the confusion effect is (imo) a generally poor one for combat I think the sheer length of time means this has to be a high level. Hence I think it should be level 7.
Geas might be similar, but has effectively no combat use, so that probably puts a lower bound of 5th level..