Most of the work was fighting macOS. Accessibility is the only public way to move other apps' windows, and macOS clamps, retiles and re-sends move notifications, so a naive layout loop fights itself. It needed a spring animation fed by the display refresh timer, and a lot of per-app workarounds (apps that refuse sizes, apps that report their position late, tabs, dialogs, Spaces).
It idles at about 0.1% CPU. Paid, one-time. Happy to go deep on the internals.