MAXScript can access the active slot in the material editor. The system global variable activeMeditSlot contains the index of the currently active Material Editor slot.
You can read this value to find the active slot, or assign an integer (between 1 and 24) to it to set the active slot.
activeMeditSlot = 5 -- set slot 5 to active slot
mtl = meditMaterials[activeMeditSlot] -- pick up active material/map
Material Editor Access
Material Level Show-in-viewport State