Python and Blender. Why does any editing on my box create a new box?
So lets add line-by-line comments to your code:
# Import bpy tells Python you're using the Blender main library
import bpy 

# create a brand new cube
bpy.ops.mesh.primitive_cube_add()

# make 'box' a reference to the active object
box = bpy.context.active_object

# set the box's z location to 4
box.location[2] = 4
# set the box's x location to 2
box.location[0] = 2

As you can perhaps see from the comments, every time you execute bpy.ops.mesh.primitive_cube_add(), you're going to get a new cube. Removing that line means you will move whatever object is active. You could explicitly move the default cube with:
 box = bpy.data.objects['Cube']

Where 'Cube' is the name in the outliner.
You can also move the box using a vector like this:
 box.location = (2,0,4)