Hello Jennifer,
I looked up the verse and its commentary (Bodhasāra of Narahari, Banaras Sanskrit Series, edn, p. 63). It appears to me that referring Gurus who replace mamatā with samatā, the verse is poetically calling the Gurus the best of Grammarians. The verse is using the grammatical trope of instituting a replacement (ādeśa) in the place of (sthāna) something. The process of replacement effectively removes the original and brings into existence the replacement. Patañjali defines the original (sthānin) as yaḥ bhūtvā na bhavati, and ādeśa "replacement" as yaḥ abhūtvā bhavati. Narahari's verse is not referring to any actual grammatical rule that replaces "ma" with "sa", but is simply referring to the idea of replacement in the grammar. At least that is what it seems to be.
Madhav Deshpande