Ha! Found it. I thought I remembered seeing something like this:
This only switches between two windows, but I'm sure it could be modified to handle more, although the logic might take a while to figure out, as the window numbers change each time you bring one to the front.