You don't call an animated, floating group of gears magical/mystical in some way? Also I wouldn't call the Porygon family anymore magical/mystical than Klinklank and they're able to learn Trick Room (Porygon-Z even learns it via Level-up!). Maybe Klinklank is able to manipulate the invisible "gears of time" and spins them in a way to cause the turn order reversal.
Judging by the Porygon family's ability to learn Shadow Ball, Ice Beam, Psychic, Thunderbolt, Dark Pulse, Signal Beam, etc., it's clear that they have a much greater capacity for manipulating energy than Klinklang. Porygon-Z gets it by level up because it's based on a glitch that messed up Porygon2's programming, so it's not a huge stretch for it to be able to glitch out the flow of time.