One should NOT stop in the middle of shemoneh esrei to listen to an ongoing keri’as haTorah. And of course if one was accidentally called for an aliyah, one should not go. If one accidentally responds to kedusha, kaddish, etc , in the middle of shemoneh esrei, he should stop immediately, even in the middle of a possuk; he must go back to the beginning of the berachah he is in the middle of.
It is muttar to sleep in a Shul for any mitzvah purpose (not only for the sake of the Shul or for davening). This includes someone traveling to perform a mitzvah,who needs to sleep to gather strength for what he is doing.