I didn't say anything of the sort.which would seem to confirm what you're saying that it would get better by reducing the time it takes to actually do the stuff.
My thought was that if you check every 50ms for changes in position/size, you have up to ~50ms between when the change occurs and when it is detected. You're also running code every 50ms even when nothing is happening. Dock works via a hook which is notified of changes. It should react immediately and with less CPU usage (though the difference is probably negligible). It sounds like you're using a timer to detect some changes for changing the Dock settings, and Dock is detecting the same changes using a more efficient method. It would make more sense to just use the hook Dock uses from your own script.
N.B. Dock also uses SetWinDelay -1 to speed up WinMove.