An approach to the calculation of Ω-splittings in diatomic molecules with strongly coupled electronic states and its application to NiH and NiD