So my three z-level compactor design, side view, only allow approaches from the right:
c^>
b+X
bb<
c hatch
^ pressure plate
b bridge
+ door
> stairs down
X stairs up/down
< stairs up
Build the bottom bridge as a drawbridge that lifts to the right and the middle bridge as a retracting bridge.
Build the hatch and bottom bridge first, then the pressure plate, then the middle bridge. This makes it so that the bottom bridge opens before the middle bridge opens. Link the pressure plate to the hatch and both bridges.
Put a garbage zone on the pressure plate and a pasture on the middle bridge.
If you want to dump garbage, just dump it. Dwarf walks to the pressure plate, hatch opens instantly, dwarf throws garbage in the chute since it's now an open pit next to a garbage zone and walks off.
At 100 ticks the bottom bridge lifts. At 101 ticks the retracting bridge retracts, dropping the trash all the way down. At 199 ticks the bottom bridge atom smashes the trash. At 200 ticks the retracting bridge fixes itself.
If you want to kill a pet, pasture it then dump something to activate the compactor.
It may be possible to use a 1x1 raising bridge on the bottom floor if you reverse the build order of the two bridges, I think, but I'm unsure if a raising 1x1 bridge atom smashes everything on it if there's nowhere to fling it.
If you don't want to smash and only want to contain the miasma then just dig two levels and no bridges and the hatch will only open for trash dumping. You can even just channel the pit, add no stairs or doors and it should be unlikely that miasma will escape in the short time the hatch is ever open. This form, however, would prevent you from retrieving anything dumped until you add another access way.
You can probably do this with just two z-levels if you omit the middle level entirely, but I don't bother because I like the pet disposal area. Also, to prevent dwarves from accidentally walking onto the bottom bridge just add a hatch between z -1 and z -2 and lock it. There is the chance that a dwarf will decide to step out on the middle bridge, but you can lock the door next to it when dumping, though I haven't had any accidents yet.