When was the first recorded instance of the custom of someone placing a hand on the mezuzah and then kissing it? It is found in the Talmudic account about the famous Roman convert to Judaism, Onkelos. He was doing this as he was being led out of his home by the third set of Caesar’s troops who were sent to capture him, and they asked him what he was doing.
He explained that, “It is the custom of the world that the king sits in the inside of the palace and the guards protect him from the outside. However, with G-d, His servants are inside their homes and He protects them from the outside.”
As with the first two troops, they were inspired by his knowledge and faith, and they converted. Caesar did not send any additional soldiers upon learning of this. You could say that the mezuzah is the first wireless Jewish security system!