1) One may think about the Torah before making the blessing. The Gr”a, however maintains that one must make the blessing even before thinking about Torah. (Shulchan Aruch and Mishne Berurah 47)
2) Even according to the Gr”a one may fulfil the commandments of the Torah before making the blessing, even though during the fulfilment of the commandment he is thinking about the laws of this commandment, since he is not intending to learn the Torah. (Mishne Berurah ibid)