You Either Need an Enormous Comet or (a Lot of) Magic
The real sticker here is "the size of the moon". The apparent size of the moon from Earth is about 1900 arc seconds. Its diameter is about 3500 km.
So all we need to do is get closer, right? Let's use Halley's Comet as an example. It's 11km in diameter. How close would it have to get to appear to be the size of the moon? $\frac{11km}{3500km}=0.00314$ So we'd need to be at 0.3% of the distance from the Earth to the Moon.
That's 1153km... which is inside Low-Earth-Orbit.
Most of our (artificial) satellites orbit higher than that. It's also waaaay inside Earth's Roche limit, but it (probably) won't be sticking around long enough for that to be a problem.
Solar Orbits Have Some Zip
Also using Halley's comet as an example, its orbital velocity is 55 km/s. So if it rocketed in close enough to Earth to be the same apparent size as the moon, it would only be that close for a timespan measured in minutes. At 55 km/s, that's 3300 km/minute, so it would have doubled its distance from Earth (and halved its apparent size) in thirty seconds.
So, Bigger Comet?
Doesn't seem that likely. While we don't have a ton of experience with other stars, we have a plethora of comet nuclei, courtesy of the Kuiper Belt. And the biggest one we've ever seen is about 130 km in diameter.
That gives you a slightly longer close-approach, but not nearly long enough for everyone on the planet to take a gander at the moon-sized comet.
So What Do We Do?
At this point, "magic". You want a smallish comet, you want it to be at an enormous apparent magnitude, and you want it to stick around. So the magical field of your planet, more puissant than the gravitational field of same, seizes the magical field of the comet and radically slows it while in proximity to the planet. As it begins to exit this interaction, the change in magical field densities flings the comet back on its way with its initial velocity. Given that you're compelled to do magical things to its orbit, the rest of its orbital structure is kind of immaterial - a high orbit out of the ecliptic could easily have 25-year periodicity.
Edit - as others have pointed out, no natural orbit would a) intersect with Earth at that kind of proximity at Earth-year intervals or b) survive the close interaction with Earth. So we're back to "a lot of magic" on that one, too.