In this question: Automatically adding space before punctuation in old-style English texts, the accepted answer uses the following definition
\edef!{\unskip\noexpand\,\string!}
What is the difference with the apparently simpler
\def!{\thinspace\string!}
apart from the \unskip which I know is not needed if ! is inputed correctly (i.e., without space before it).