I set this up years ago on STG site. When locking a topic, merging a topic or moving a topic it would add that into the post.
It worked exactly like you described on the first post. I can go back and see how I set that up and maybe put it in an ext.
These are the images that were posted with each action. Hover would show the moderator's name that locked the topic.
But it would be no problem to center some text to the right of the image instead like your image shows.
We even had it to where each user created their own images to be posted when they took an action, instead of just those three above.
Those were Ika's images above. My locked image was different:
Another example was Hanyman's which he put his avatar in it:
It was fairly easy putting that together back then. I'll look at it again and see if I can put it in an ext.