Yeay! I finally got it working!
This is my first MAXScript ever! Its function is very straight forward; it allows you to quickly toggle between the standard grey and pitch black colour of all the viewports.
The black viewport makes it easier to see particles when working with Particle Flow and the standard grey is my prefered option when working with other stuff. So this is simply an easy way to toggle back and forth between workflow.
Here's the final code that got it to work for me:
CurrentColor = (GetUIColor 41*255) as color
if CurrentColor != color 0 0 0 then
SetUIColor 41 (color 0 0 0)
SetUIColor 41 (color 131 131 131)
Feel free to try it out, you can download it here:http://www.nanne-san.com/files/maxscripts/NannesViewportColourSwitch01.ms
Let me know if there are any bugs. It works for me in max 9 and 2010.
Cheers mate, thanks for your help!