Hi - for what it’s worth, the setting for that appears to be stored in ~/.config/kwinrc. On my device, at least, turning it off writes a line to the [Plugins] section:
shakecursorEnabled=false
You might be able to use the kwriteconfig6 command from a script, similar to the approach discussed at the following link, to have that change be recognized and take effect immediately: Energymanagement via Console - #2 by johnandmegh