Any way to have windows be restored to the correct space when opening an app?
It's unclear from your question whether you have done the obvious so I will mention it just in case.
When looking at a specific space, right click (option click) on the icon (in the dock) of the app you want to "pin" to the specific space . There will be two options shown that say something like "this space" or "any space" (I'm sorry, I'm not on my Mac so I can't be more precise, but I think you will be able to understand this method)