Refreshing the Dock without actually killing it? Is there a way to change Dock preferences and make the Dock app read the new one without using killall Dock command? Like to maybe force a refresh with some AppleScript or so?
You might try

sudo pkill -1 Dock


which sends a ‘HANG-UP’ signal, also known as a ‘HUP’, to the process whose name matches Dock.  The expected response is an internal ‘stop and re-evaluate’ in which a relevant configuration file normally gets re-read.

F.