With most species of snakes there is no territoriality. There are exceptions, in certain subspecies of carpet pythons, Morelia spilota sp., males will actually engage in combat for breeding rights. This may happen with other species too. There are other potential problems. Some species of snakes, such as indigos, Drymarchon corais couperi, black headed pythons, Aspidites melanocephalus, most species of kingsnakes, Lampropeltis ssp., and many others, are naturally ophiophagic, so there can be a danger with them eating smaller cage mates, (and sometimes not as much smaller as you may think.) I personally avoid housing snakes together long term for a number of reasons, mostly that it is harder to monitor their health and overall condition.
The adult male carpets can bite, but it usually similar to what you saw with the cobras, a kind of wrestling match. People do it to encourage breeding sometimes, there are varied opinions on how and when to do it, if at all and with what animals. You should be present to watch to ensure there are no problems.
I found a video online of some wild carpets fighting. They look to be some form of coastal carpets, Morelia spilota mcdowelli, hard to say for sure, mcdowelli have such variation in the wild, and in captivity. Most of the comments seem to think they are mating, but that is not how snakes copulate. That is two male engaging in combat for breeding rights.
Yes, at the moment I only have two snakes together, a pair of 2010 bredls pythons, Morelia bredli, and am working on resolving that. And to some extent, they are all over the place. There are few in the living room, one seems to like to watch t.v. at night. Most of them are in one room, which is the warmest room in the house, actually a very large walk-in closet. There is a homemade rack in there with some other things. I don't like the standard rack systems sold, as I like to give the animals some space. Most commercial racks are meant to be tight fitting, and very few have any height to the tubs. I'll put a thread soon with some pics and such.