The following script errors if you move a window from an app that should be in one space to another.
I did it using AS Editor, but if you have another app (scriptable or not) that has windows in more than one space then you will see the problem.
Well, open 2 windows in ASE and move one of them to another space.
Run the following script:
<script>
tell application "System Events"
tell application process "AppleScript Editor"
try
get name of window 2
on error e
display dialog e giving up after 5
end try
end tell
end tell
tell application "AppleScript Editor"
get name of window 2
end tell
</script>
Two things, first you will see that System Events can't see a window of the process if the window is in another space.
The app can.
Second, the dialog will show up in a different space. This is a general problem with the OS.
If one uses spaces it is some time very hard to find a dialog that is displayed by certain apps. One has to start closing windows because the dialogs are not shown when one activates Spaces.