If I'm working on an app or in another window I will occasionally slide an idle window or app to the right or left to just get it out of the way temporarily. Often I go too far and find myself in a different space. Is there a way to prevent this?
You must hover with the mouse at the edge of the space for a certain, very brief, period of time before the space switches. To avoid this, you can increase the timed delay such that you never inadvertently trigger the behavior:
defaults write com.apple.dock workspaces-edge-delay -float 9; killall Dock;