The basis of this Macro Group is fairly simple and uses a combination of Keyboard Maestro's inbuilt Actions to save window coordinates to Dictionaries and then restore those Windows and their coordinates later. In the latest version 5.02 (uploaded 22-04-14 replacing version in the first post) I've started using Keyboard Maestro Subroutines which makes it a lot simpler to work out what the Macros are actually doing (by just looking at the Subroutines).
I've no idea if you could adapt to work with multiple desktops/workspaces as I never use them. But with Keyboard Maestro anything is possible! Or check out @_jims solution which is directly related to what you are looking for I think.