Catalyzes the two serial methylation steps for the conversion of the 7-monomethylguanosine (m(7)G) caps of snRNAs and snoRNAs to a 2,2,7-trimethylguanosine (m(2,2,7)G) cap structure. The enzyme is specific for guanine, and N7 methylation must precede N2 methylation. Required for pre-mRNA splicing, pre-rRNA processing and small ribosomal subunit synthesis. Involved in nucleolar structural organization. a 5'-end (N(7)-methyl 5'-triphosphoguanosine)-ribonucleoside in mRNA + S-adenosyl-L-methionine = a 5'-end (N(2),N(7)-dimethyl 5'-triphosphoguanosine)-ribonucleoside in mRNA + H(+) + S-adenosyl-L-homocysteine a 5'-end (N(2),N(7)-dimethyl 5'-triphosphoguanosine)-ribonucleoside in mRNA + S-adenosyl-L-methionine = a 5'-end (N(2),N(2),N(7)-trimethyl 5'-triphosphoguanosine)-(ribonucleoside) in mRNA + H(+) + S-adenosyl-L-homocysteine Substrate inhibited by S-adenosyl-L-homocysteine. Optimum pH is 8.0. Monomer. Belongs to the methyltransferase superfamily. Trimethylguanosine synthase family.