While it might be praiseworthy to take special steps to avoid unwitting transgression, it is somewhat unusual to call this an obligation. Certainly calling it a "great mitzva" is surprising.
What is most surprising is that carrying something in the pockets unwittingly is not even a Torah prohibition on Shabbat! As Tosafot (Shabbat 11b) point out, on Shabbat, unlike in other areas of halakha, transgressions require an element of forethought: "only labors of forethought are forbidden by the Torah". It would seem that Chanania's admonition falls into the category of “marit ayin” - actions taken to prevent the mere appearance of transgression. This category is certainly very important, yet it is still surprising to call it a "great mitzva".
Rav Kook explains that there is a special importance to concern our- selves with external appearances on Shabbat. He writes that at the most fundamental level, Shabbat is completely inner. During the week we become absorbed, even obsessed, with matters which are completely external and ephemeral, and we have a tendency to forget the deep inner world of holiness. "How far [from holiness and repose] are our external lives, which are so complicated by the many calculations which men seek for themselves, forgetting that G-d created them straight". Therefore, "Shabbat returns us to the strength of inner life, which are weakened by the abuses of our external life in its crass form".
However, the fullest expression of the holiness of Shabbat is not as an escape out of our coarse weekday existence; on the contrary, ultimately Shabbat is meant to radiate its inner beauty into our external, material existence. We are not meant to live segregated lives of inward refinement and outward coarseness; rather, we are meant to elevate our outward existence so that it rises towards the perfection of our innerness.
For this reason, we find many decrees of the prophets which regulate the external aspects of Shabbat. Whereas the Torah forbids melakha, the prophets obligated us to where special Shabbat clothes, to have a distinctive relaxed Shabbat demeanor, and so on. All these decrees are meant to enable the inner light of Shabbat to find an outward expression on Shabbat itself, as an intermediate step towards expressing themselves in our weekday existence. (Ein Ayah Shabbat 12a.)
On the border between weekday and Shabbat, on Friday afternoon as Shabbat comes in, is the ideal time to emphasize not only the distinction between Shabbat and the week, but also the connection between them. As we are still partially absorbed in the world of outwardness, we take the trouble to ensure that our Shabbat outwardness - the appearance of observance - is as scrupulously kept as its inwardness. In this way we remember that the inner harmony and repose of Shabbat radiates into all of our activities.
[Ed. note: Even in a proper eiruv-enclosed area, it is a good practice to check one’s pockets before Shabbat, lest there be items not appropriate for Shabbat in them (e.g. money, bus ticket, pens, etc.]
Rabbi Meir's book Meaning in Mitzvot is now available as an e-book through Amazon, ibooks, Google Play and B&N.