Top Ten Good Habits For MEL Scripting
10. Save all MEL in a file outside of Maya, so you always have access to it and so Maya can't corrupt the only copy.
9. Use white space to keep track of nested loops and to separate different stages in long procedures.
8. /* Comment your work whenever an instruction isn't readily obvious. */
7. Use variables whenever possible. "Hard coded" values reduce re-usability and increase the difficulty of maintenance.
6. Use variable names that make sense. $elbowOffset is easier to find and use than $value3.
5. Avoid making a single script that is over generalized to cover a huge variety of hypothetical scenarios. Design the tool to solve the problem at hand and edit as necessary.
4. Functionality before polishing. Get it working, then worry about optimization and user interface.
3. Research. Someone may already have a script that does what you need.
2. Every command must end with a ;
1. Evaluate the need for MEL. Just because it can be done with a script doesn't mean you should.