Catalyzes the methylation of dimethylglycine to betaine with S-adenosylmethionine (AdoMet) acting as the methyl donor. It has strict specificity for dimethylglycine as the methyl group acceptors. N,N-dimethylglycine + S-adenosyl-L-methionine = glycine betaine + H(+) + S-adenosyl-L-homocysteine Optimum pH is around 8.5 for dimethylglycine. Amine and polyamine biosynthesis; betaine biosynthesis via glycine pathway; betaine from glycine: step 3/3. Monomer. Belongs to the methyltransferase superfamily.