The sequential IF statements cancel each other
Here is a simplified version of your program logic. If you run this in the Scratch IDE you'll find that the output value is the same as the input value. Why doesn't the value change when it is greater than screen_x?
If you follow the comments in the figure, you'll notice that both "if" statements are executed. The first changes the value and the second changes it back. So this logic clearly won't help us reverse the trajectory of the ball. You might be able to fix this by instead using if-then-else logic, but there is a much better way.
(click image to enlarge)
Fortunately, Scratch can handle the ball physics for you with an If on Edge, Bounce block. See the Pong Starter by ScratchTeam for an easy example.