My nephew started doing this and gradually got worse until he bit everyone in sight. The "usual discipline" (this was 20 years ago ) did not work and in the end his mother bit him every time he bit some one - was the only thing that stopped the little imp. He appears to have grown out of it now.
Afraid I did similar in a supermarket - My second son, then aged 4 kicked me- I returned promptly but firmly a similar kick, saying 'it hurts doesnt it'? - dont do it again- unless you want to get same back - he didnt do it again.
Having 4 boys and running businesses- didnt have time for a naughty step. But all well adjusted men with good moral judgement