Not sure of the meaning but the tradition is an old one in scotland no one would walk widershins round a kirk lest you call forth that which righteous folk feared.
Highland folk in particular were thought to be very supersticious and there are man tales of auld sootie trying tae get guid fowk.