Since the gram weight was part of the metrical system developed during French Revolution, I do not think it could be related to 'grammer'.

Font of knowledge that she is, I believe helen has gotten the connection backwards here. The root of grammar is from the Greek gramma meaning letter.

http://www.bartleby.com/61/77/G0217700.html

The word shifted in meaning to mean a small thing and it is from this meaning that the SI took its basic unit of mass.

http://www.bartleby.com/61/75/G0217500.html