All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
Whoever swears to divorce his wife and conditions this upon doing a given matter, then it is not possible to withdraw or invalidate this oath, according to the view of the majority of the jurists ; rather according to them divorce takes place if one does what he conditioned the divorce on.
However, some scholars are of the view that if one intends by his oath to prevent himself from doing something and not to divorce his wife, then divorce does not take place but he is obliged to expiate for breaking his oath.
For more benefit in this regard, please refer to Fataawa 83063 and 83463.
Since the issue is controversial, then it is more appropriate to take the matter to an Islamic court as it is more suitable for them to study divorce matters and the like, and because the ruling of the judge removes the disputes in matters of Ijtihaad (a juristic opinion on matters which are not specified in the Quran or the Sunnah).
Finally, it should be noted that having intercourse with one's wife during menses is forbidden and a Muslim should refrain from this in all cases, and he should avoid using the words of divorce as a means to prevent himself from any act, because uttering the word divorce causes problems.
For more benefit on the ruling of having a sexual intercourse with one's wife during menses, please refer to Fataawa 84471 and 85928.
Allaah Knows best.