Not sure why you seem to be totally ignoring the general consensus here.
Most of us have been there, done that. You are going into a roommate situation knowing you will have trouble, knowing it won't work due to your personalities and even thinking it will end up in court. Bottom line, not a good idea all the way around.
It's no different than it you were telling us you were planning on getting married, but didn't like many things about the guy, didn't think you would do well living together and figured you need to write up a contract to force him to be the husband you are looking for (in order to protect yourself for 'divorce court') ...we would all say DON'T DO IT.
It's obviously not a good idea. You cannot force someone to be a compatable roommate, not with a contract...not with all the talking in the world. If you are not compatable, you should not move in together. It's that simple.