Sounds like a scripting brush
But it should be implemented into Krita core
+1 from me to have such a functionality though.