Ah, ok, I misunderstood that this will inherit by session since I thought kwin start the script exit-with-session.
But then I still have one minor concern, for any window that actually inside kwin (e.g. right click on title bar -> window specific settings), the input method will be forced to qtvirtualkeyboard. Though I know input method is not commonly being used there, but I don't think that's expected behavior for input method user.
That dialog is a separate binary kwin_rules_dialog. Except for the virtual keyboard and wayland debug console I don't think there are any user-facing kwin-internal windows (that are real windows, not counting stuff like close buttons on present windows and so on)