logic order should be:
Edit: actually just try replacing your transfrom.translate(v*4,0,0) with transform.translate(moveVelocity)
check the moving boolean
if it's false
check the input axes thing
if you have a key/whatever pressed
set movevelocity to some value based on which direction you need to move.
set moving to true
if it's true
on collision with other block
set moving to false.
and assign the moveVelocity variable based on the input.