Are there technical limitations for implementing this idea?
No, you can go ahead and program something like that. The issue with swap is that it's very slow, it's very unpredictable, it increases latency, it impedes normal IO operations and in certain situations it does more harm than good, e.g. if you've got an application whose RSS is growing uncontrollably: you try to create swap to accommodate its appetite, the kernel swaps out everything that you're actually using, and the system grinds to a halt.
My advice has always been and remains: add RAM and do not use swap. Swap must be used only when you cannot add RAM out of physical (laptop with no free slots) or financial (shared hosting) limitations.
In Linux, swap can be used for hibernating but that's it. I'm not even convinced by hibernation any more because the tech was created for HDD disks which are very slow for random IO. With today's SSDs there are very few reasons to use hibernation.