How does the vibration switch work?
Does it just have an ON/OFF output that can be detected with digitalRead()?
The code you posted takes account of the fact that analogRead() produces a value between 0 and 1023.
Would it work sufficiently well if you converted your digitalRead() into either of the values 0 or 1023 - i.e. the extremes of analogRead()
You need to explain more clearly how you want your program to respond to the inputs and whether you want a different response to the vibration input compared to the analog input.
...R