Change materials via spinner

Hello :)

I was wondering is there a way to change materials (50+) via spinner in MaxScript? Assuming that Compact material editor has max 24 free slots to cycle, can it be done in Slate material editor or in material library? (in my case all of the materials are "standard") I made a simple script to test it out in Compact ME just to specify my problem a bit more.
What I want my script to do is to choose mesh by name (filtered for just geometry) by Button and printed name of that mesh in edittext below button to check chosen and use spinner to cycle materials (in any way) to that mesh. There is a edittext box under spinner that would print material name just to check. That should be automated process of cycle through materials >select object - select material - assign material to selection - show shaded material in viewport< --every specific material is standard and have different diffuse bitmap and self illumination set to 100--

I would appreciate help with the code or an example similar to this if someone is familiar to this kind of issue. Thanks in advance.
Script is in the attachment.

scriptproblem_material_01.ms970 bytes