Maya has many MEL scripts it uses for its user interface and other operation details. You can examine these scripts to see the techniques of professional script writers at Autodesk (formerly Alias). The scripts are in the startup and others directories at these locations by default:
(Linux) /usr/autodesk/maya2011/scripts
(Windows) drive:\Program Files\Autodesk\Maya2011\scripts
(Mac OS X) /Applications/Autodesk/maya2011/Maya.app/Contents/scripts
If you want to modify scripts in this directory to alter the Maya interface, copy them to your local scripts directory first. If a script in your local scripts directory has the same name as a script in the Maya internal script files directory, the one in your local scripts directory executes.