I was wondering, is it safe to install Xcode 4.2 on top of Xcode 4.1 ? Will it break things like homebrew or other, that uses command line tools provided by Xcode ?
Answering the first part of your question.
If you do install different versions (or builds) of Xcode on the same Mac boot up hard drive, recommend you give the "newer" Xcode a different name. Else your development environment becomes unstable even if you "sudo /Library/uninstall-devtools".
An example of "unstable" is drag-to-connect UIKit object on the XIB to the IBOutlet code won't "stick".
I'd suggest someone move this question to stackoverflow.com.