That verse appears to be from the Kumbakonam Edition of the Southern Recension of the Mahābhārata:
3.77. adhyAyaH 077
Mahabharata - Vana Parva - Chapter Topics
puShkaraM niShkAsitavatA nalena kuNDinapurAtsaputrAyA damayantyA AnayanapUrvakaM prajApAlanena sukhavAsaH .. 1 ..
bR^ihadashvena dyudhiShThirAyAkShahR^idayavidyopadeshapUrvakaM saMkShepeNa harishchandropAkhyAnakathanam .. 2 ..
Mahabharata - Vana Parva - Chapter Text
karkoTakasya nAgas damayantyA nalasya cha.
R^ituparNasya rAjarSheH kIrtanaM kalinAshanam .. 3-77-12
In the Critical Edition, Ch. 63 of the Vana Parva, the verse is prefixed with a
* meaning it's an interpolation:
03,063.001 bṛhadaśva uvāca
03,063.001a utsṛjya damayantīṃ tu nalo rājā viśāṃ pate
03,063.001c dadarśa dāvaṃ dahyantaṃ mahāntaṃ gahane vane
03,063.002a tatra śuśrāva madhye 'gnau śabdaṃ bhūtasya kasya cit
03,063.002c abhidhāva nalety uccaiḥ puṇyaśloketi cāsakṛt
03,063.003a mā bhair iti nalaś coktvā madhyam agneḥ praviśya tam
03,063.003c dadarśa nāgarājānaṃ śayānaṃ kuṇḍalīkṛtam
03,063.004a sa nāgaḥ prāñjalir bhūtvā vepamāno nalaṃ tadā
03,063.004c uvāca viddhi māṃ rājan nāgaṃ karkoṭakaṃ nṛpa
03,063.005a mayā pralabdho brahmarṣir anāgāḥ sumahātapāḥ
03,063.005c tena manyuparītena śapto 'smi manujādhipa
03,063.005d*0300_01 tiṣṭha tvaṃ sthāvara iva yāvad eva nalaḥ kva cit
03,063.005d*0300_02 ito netā hi tatra tvaṃ śāpān mokṣyasi matkṛtāt
03,063.006a tasya śāpān na śaknomi padād vicalituṃ padam
03,063.006c upadekṣyāmi te śreyas trātum arhati māṃ bhavān
03,063.007a sakhā ca te bhaviṣyāmi matsamo nāsti pannagaḥ
03,063.007c laghuś ca te bhaviṣyāmi śīghram ādāya gaccha mām
03,063.008a evam uktvā sa nāgendro babhūvāṅguṣṭhamātrakaḥ
03,063.008c taṃ gṛhītvā nalaḥ prāyād uddeśaṃ dāvavarjitam
03,063.009a ākāśadeśam āsādya vimuktaṃ kṛṣṇavartmanā
03,063.009c utsraṣṭukāmaṃ taṃ nāgaḥ punaḥ karkoṭako 'bravīt
03,063.010a padāni gaṇayan gaccha svāni naiṣadha kāni cit
03,063.010c tatra te 'haṃ mahārāja śreyo dhāsyāmi yat param
03,063.011a tataḥ saṃkhyātum ārabdham adaśad daśame pade
03,063.011c tasya daṣṭasya tad rūpaṃ kṣipram antaradhīyata
03,063.012a sa dṛṣṭvā vismitas tasthāv ātmānaṃ vikṛtaṃ nalaḥ
03,063.012c svarūpadhāriṇaṃ nāgaṃ dadarśa ca mahīpatiḥ
03,063.013a tataḥ karkoṭako nāgaḥ sāntvayan nalam abravīt
03,063.013c mayā te 'ntarhitaṃ rūpaṃ na tvā vidyur janā iti
*0301_01 karkoṭakasya nāgasya damayantyā nalasya ca
*0301_02 ṛtuparṇasya rājarṣeḥ kīrtanaṃ kalināśanam
03,063.014a yatkṛte cāsi vikṛto duḥkhena mahatā nala
03,063.014c viṣeṇa sa madīyena tvayi duḥkhaṃ nivatsyati
03,063.015a viṣeṇa saṃvṛtair gātrair yāvat tvāṃ na vimokṣyati
03,063.015c tāvat tvayi mahārāja duḥkhaṃ vai sa nivatsyati
K M Ganguli includes this verse in his translation and clearly Sage Bṛhadaśva is referring to recitation of the entire story of Nala-Damayanti so I assume anyone can recite it (see Can't Śūdras read the Bhagavad-gītā?).
Vrihadaswa said, '...And, O lord of the earth, Nala suffered such dire woe all alone and recovered his prosperity, whereas thou, O son of Pandu, with heart fixed on virtue, art sporting in joy in this great forest, accompanied by thy brothers and Krishna. When thou art also, O monarch, mixing daily with blessed Brahmanas versed in the Vedas and their branches, thou hast little cause for sorrow. This history, besides, of the Naga Karkotaka, of Damayanti, of Nala and of that royal sage Rituparna, is destructive of evil. And, O thou of unfading glory, this history, destructive of the influence of Kali, is capable, O king, of comforting persons like thee when they listen to it. And reflecting upon the uncertainty (of success) of human exertion, it behoveth thee not to joy or grieve at prosperity or adversity. Having listened to this history, be comforted, O king, and yield not to grief. It behoveth thee not, O great king, to pine under calamity. Indeed, men of self-possession, reflecting upon the caprice of destiny and the fruitlessness of exertion, never suffer themselves to be depressed. They that will repeatedly recite this noble history of Nala, and that will hear it recited, will never be touched by adversity. He that listeneth to this old and excellent history hath all his purposes crowned with success and, without doubt, obtaineth fame, besides sons and grandsons and animals, a high position among men, and health, and joy...'
So instead of making a mantra out of the verse and repeatedly chanting it, the focus should be on the story and the lessons it teaches.