The best way to look at whether moving a ball is a foul or not is to determine the outcome of the table due to the moved ball. If the moved ball changes the outcome of the table (touches a moving ball, or moves away from a ball hitting it) the shot is a foul. If there was no change in the outcome of the table due to the moved ball, the shot is not a foul. The opponent has the option to move the ball back to its original position, or leave it as is.
As for shooting over a ball, it is not a foul to move the impeding ball, unless it has an outcome on the shot, or touches the cue ball. This is a bit tricky to call as a referee. If the cue ball is frozen to the impeding ball, any movement of the impeding ball during the stroke, it is an automatic foul, as the moved impeding ball moved the cue ball before the tip struck the cue ball, thus foul. If the cue ball is not touching the impeding ball, its quite tough for a referee to prove the cue ball foul, thus it would most likely be called a good hit, unless the moved ball changes the outcome of the table as described above.