Since your question infer that you're aiming to have both Xcode 3 and Xcode 4 installed on the same Mac, your approach (described in your first paragraph) is correct that you need both to be installed in different paths.
In my company, to achieve your goal, the engineers
- first ensure the development Mac is clean (i.e. no residual libraries, receipts, etc) by executing
sudo <Xcode>/Library/uninstall-devtools --mode=all
- after rebooting (to ensure any libraries in memory are released and their files can be deleted by emptying the Trash), empty Trash.
- install Xcode 3 in a path other than the default /Developer path.
- Install Xcode 4 in a path other than the path (specified in step 3) though majority of the engineers simply install at the default /Developer path.
The reason why we install Xcode 4 after installing Xcode 3 is to ensure the latest supporting development binaries & tools are installed. FYI, these binaries & tools are not in your specified /Developer folder but in default paths throughout the Mac startup partition.
From your description in paragraph 2, one possibility is you have "nested" installation of Xcode, one on top of the other. You'll have to remove the files installed or partially installed (by Xcode installer) to return your Mac to a clean environment before running the Xcode installer again.