This is a disassembly of sprite 3E, the POW/P-Switch.
Extra bit is used to determine whether the switch will be blue, or silver.
This includes the full routines for handling the sprite while it is not being carried and susceptible to physics, and while the sprite is being carried by the player. For ASM hackers you should be able to tweak the sprite to a fair degree and use as a base for custom objects.
As of submission, PIXI does not support custom sprites through sublevel transitions so the sprite will become a vanilla P-Switch sprite when carried through a pipe/door/other transition.
The configuration options for what palettes the blue and silver switches should use just refuse to work. Everything else checks out, just be sure to snip out unnecessary code to keep from cluttering up the sprite too.