However, for the sake of argument, let me expand a bit on my previous idea. These groupings of windows would be running, essentially, virtual desktops invisibly. To get make them visible should only require a tiny bit of UI code.
To your specific example, I don't know why you'd have a task that requires 20 windows. However, for the sake of understanding, you'd still have those 20 windows to sift through on your virtual desktops.
You then change the background for each desktop so it's immediately apparent where you are at the moment. Visual memory ftw.