If I swap Zed with a shadow clone, does a targeted spell still hit Zed or hit the clone?
The spell still hits Zed — the Shadow Clone is never the target.
Targeting locks onto the game object (Zed), not his location. When he swaps places with the clone, the targeting relationship follows Zed across the board (same principle as the Alpha Strike clarification: the "arrow" stays on the unit as long as it remains on the board). The clone was never chosen, so it can't become the spell's target.
What actually matters is whether Zed still meets the spell's targeting restrictions at resolution (Rule 359.3.e.5). If the spell just needs "a unit" and he merely moved battlefield-to-battlefield, he's still legal and takes the effect. But if the spell required him to be at a specific battlefield or in combat (e.g., Hidden Blade, or a "unit in combat" requirement), Zed is no longer a legal target after the swap — the spell misses and does nothing to the clone either.
One timing note: Zed's swap is an [Action] ability, so it can't be activated in direct response to a spell already on the Chain (that's Closed State, Reaction only). It only works in Open State — your Main Phase, or mid-combat during Showdown Open.