Interesting idea but I’d imagine going with a custom module instead of a filter plugin as you’d potentially want to store / update multiple variables within the vault.
Some logistical questions to ask yourself in your implementation:
Does this module support vault ids?
Can the password of the vault be the same or different from one used with running ansible itself?
Does this overwrite the vault with subsequent calls or should it merge new variables with existing content? Does it provide an option to overwrite?
Lastly, I recommend looking at the Ansible code the interacts with vaults to see which modules you can import to make this happen without boiling the ocean.