Shock sensor is not running in the file
I'm pretty certain that your code is the problem.  You are relying on timing rather than events.  Using delays is OK when you are just interfacing to one sensor but when you start mixing them you end up with issues like this.  

You are reading the vibration sensor once every second if the distance is 4.  So any vibration needs to occur for more than one second, or at exactly the right time.  I think you need to look at a better way of coding the solution without using the big delay statements, maybe look at interrupts.