I'm designing a world, and I really like the idea of a recurring moon. If a planet were in the proper orbital resonance with another planet, is it possible that moons might occasionally traverse between the two? How might that occur, and what restrictions would there need to be?
It is simply not possible without actively adjusting orbits
For an asteroid to get captured as a moon is actually very tricky, it is most easily achieved through a collision, or a momentum exchange with a 3rd body via gravity. The reason why capture is difficult, is that if an object falls "from infinity" towards a planet it has escape velocity and so it will indeed escape, following a hyperbolic orbit. Capture is very nearly a fluke, and often involves an interaction with a 3rd body such as a collision to lose some of that velocity.
Once captured, escape is even more difficult, and will only happen through an interaction with a 3rd body - most likely the gravity of a massive passing object pulls it out of orbit. Of course, the massive passing object will also seriously perturb the orbit of the planet - and that is also why the other planet cannot be that massive body - if the two planets pass so close together as to steal each other's moons, they will shortly collide or have a violent gravitational interaction which flings them into very different orbits.
So for a moon to fall between two different planets being captured and then lost by them in turn, would require a series of flukes. Under the environment the transfers could happen, the orbits of the planets themselves would be highly unstable, and some of the bodies would have to collide or be flung out of the system before the system could adopt a stable state. In other words, even if it could be set it up to happen once or twice (and no doubt it could, in an evolving solar system), it wouldn't be stable in any cosmic time scale.
Occasionally traverse, no--Blake Walsh addressed this case fine.
However, it's not theoretically impossible to have a "moon" that orbits neither planet but rather goes back and forth between them.
In practice you'll never find this because it's an unstable path and soon would wander off. Put a guidance system and some engines on it and you could have a traveling "moon", though.