The Kitzur Shulchan Aruch states that a person should not run out of shul after Shacharis because then davening will look like a burden to him. If the person is going to the Beis Midrash to study, though, not only can he run, but it meritorious to run to there.