These two words seem well and truly mixed up in modern Irish, probably due to their similar or identical pronunciation:
Cóir would be /ko:rʹ/.
Cómhair would be rather /kõ:rʹ/, with a nasal vowel.
PUL was at any rate convinced these words were pronounced differently (see his Notes on Irish Words and Usages: “there is a full nasal sound in cómhair which it is impossible to mistake for cóir”); however, nasalisation is not a distinguishing feature of present-day Cork Irish. The Irish of West Muskerry showed that Amhlaoibh Ó Loingsigh, noted for his careful pronunciation, did not distinguish these words, and I don’t believe these words are pronounced differently in Muskerry today.
Niall Ó Dónaill’s dictionary claims that cómhair should only be used in the prepositional phrases i gcómhair, “for” and os cómhair, “in front, before”. However, this is unsatisfactory, as such phrases contain nouns in the dative, and so the question remains as to what the noun in the expressions is and how that should be spelt when not found in those phrases.
I am not a fan of Ó Dónaill’s dictionary, which contains thousands of fabricated words, in addition to giving historically incorrect word morphology that fails to correspond to any living dialect either. Could it be that i gcómhair “for” is spelt thus in his dictionary to create a nuance of difference with i gcóir, “in right order, ready”? Did Ó Dónaill have any knowledge or evidence of the origin of these phrases, and did he base his choices on such knowledge? Or did he adopt an arbitrary approach to differentiate certain phrases?
If we turn to Dinneen’s dictionary, we find that cóir means “right, justice, fair play; instrument, proper arrangement”. I gcóir is given as meaning “justly, ready, aright”. Cómhair means “presence”, with os mo chómhair logically meaning “in front of me”. Dinneen gives do chómhair for “near”, and not de chóir: the de of Standardised Irish might seem more logical here, but by the same token Dinneen’s association of the word with cómhair also makes more sense. By contrast, Ó Dónaill seems to mix things up by given two separate words spelt cóir, one meaning “justice; proper provision or equipment” and the other meaning “nearness”. But if cóír means “nearness”, why does he not spell os cómhair os cóir? Or if it is os cómhair, why is it not de chómhair?
PUL disagrees with both Dinneen and Ó Dónaill. He also shows the meaning of cóir in Notes on Irish Words and Usages as “means” or “equipment”, and gives the meaning of cómhair as “presence”. But he argues that the phrase written i gcómhair by Dinneen (and adopted in Standardised Irish) should be i gcóir: in other words i gcóir meaning “for” derives from a word meaning “means, equipment, fair share” and not from a word meaning “presence”. His comment that cómhair and cóir are pronounced differently is given directly in the context of his discussion of i gcóir, showing that he did not have a nasal vowel in this phrase. He shows the contrast between cóir and cómhair thus:
Tá do chuid os do chómhair amach: your share is before you.
Tá do chuid id chóir: your share has been put by for you.
It seems there are two issues here: one is one of pronunciation, and the other is of etymology. PUL may be saying that i gcóir is definitely pronounced i gcóir and not i gcómhair. But whether he has the etymology right is other thing, as the Dictionary of the Irish Language, a dictionary of early Irish, seems to show i gcómhair, although the two words seem to have been confused at an early date.
Maybe no one really knows the etymology of these phrases for sure. But PUL was firmly of the view that we should write os cómhair but i gcóir. The late 17th century work in Cork Irish, Párliament na mBan, has fád chomhair, “awaiting you” in Brian Ó Cuív’s glossary, but a ccóir (old spelling for i gcóir), “in preparation for”. It is possible the etymology is from i gcómhair, but that the word has come to be understood as “in preparation for” in Cork Irish. It is also possible, as Dinneen indicates, that there are two phrases, i gcóir, “in preparation for, ie ready”, and i gcómhair, “for, waiting for”, whose meanings were so close that they became aligned in the speech even of those old speakers who had strong nasalisation, leading to PUL’s strong conviction that i gcómhair must be from cóir and not cómhair.