I wouldnt advice running after your dog and "giving him a shake by the scruff" Its sending mixed messages, first your following him putting him in leadership position and even thinking its a game running further away then when you hit him he won't know what its for and will start associating you with fear.
As said reward him for coming back. If you see another dog/people .. slip him on the lead and keep his attention on you till they have gone .. play with him, a little sqeek of a toy and plenty of waving it about and once the people/dogs gone throw it for him. Two birds with one stone, re