May be involved in the biosynthesis of caffeine. Binds 1 Mg(2+) ion per subunit. Alkaloid biosynthesis. Expressed in roots, stems, young and old leaves. Belongs to the methyltransferase superfamily. Type-7 methyltransferase family.