My feeling is 6 might just be a convenient figure used by the warner to indicate some or many. Apparently she/he wanted the boy to keep an amount of distance away from her/him for the purpose you pointed out. Maybe I took it too literally with an impression that ‘space’ was subject to being two/three-dimensional. But actually ‘space’ could be one/two/three-dimensional according to some dictionary I have checked up the word with right now. So, now I wonder, does it just mean ‘distance’ or ‘steps’ just as you said? Or is it related to some kid’s game such as hopscotch?
Clearly the ‘six spaces’ suggests stepping back or away and indicates ‘paces’. On board games where you have to move a small plastic figure around a board according to the number shown on the dice that you have thrown, we usually refer to the different squares on the board as ‘spaces’ as in: Move six spaces to the right/left.