What you've done in your code is what i like to call 'Block' collision detection, where you are testing for a case where Object A is within Object B.
This is fine if you have unit, integer, velocities and tracking that never exceeds 1, as soon as you introduce larger values it is possible for ghosting/clipping to occur. (Object A passes through Object B and appears on the other side) In this case you can end up within the object you're testing for which will cause your if statements to freak out (and the first in the order will be the reaction that applies).
To solve this unfortunately(fortunately for some) requires the use of some math, specifically the kind of stuff you could do in high school..
"I have a train that is traveling east at 25km/h, and a train traveling west at 10km/h, they are 40km apart, when will they collide?"
Determining the side at which its coming from requires calculating the direction of movement or a vector (if the ball is moving up, and the object is above the model, then it cant hit from the top can it?) and determining the reaction is a case of newtons third law (for every action, an equal and opposite reaction) which will change the vector's angle (flipping either X velocity or y velocity)