Questions on apparent motion of superior planets Question
Why is it that superior planets seem to oscillate up and down of the ecliptic, from the view of an observer on Earth, with a period equal to the planet's orbital period?
Additionally, why do these superior planets seem to come closer to the ecliptic when they are nearing conjunction and drift away from the ecliptic when they are near opposition?
Attempt
Does it have to do with the Earth's tilt?
The planets do not orbit in the same plane as the Earth, they are inclined by a few degrees. This means that as they orbit the sun, they are sometimes above the plane of the Earth's orbit and sometimes below.  And it takes one orbital period to go the full cycle from above, to below and back to the start.
The reason that they appear further from the ecliptic at opposition is a matter of perspective.  At opposition the planet is close to the Earth. And nearby things appear bigger. So the planet will appear (in general) to be further from the ecliptic at opposition.