A good starting point might be the
Programming Fundamentals user guide in the official documentation on the Mathworks site. Regarding comments, I guess you refer to the first comment lines that provides the help topic of the function/script. You can check the comments in the M-files of the official matlab toolbox and follow their style. If you develop something you consider useful to the scientific community, you can always submit it to the
Matlab central file exchange facility, so that other users can provide useful comments and feedback.
Here you can find a brief guide about
Guidelines for writing clean and fast code in MATLAB. Hope this helps.