Have a read of these:
Associate an app with a space
Use Keyboard Maestro to move an app to a space
Automating window management across spaces