If I were to do it, I would make it so the pedal spindle doesn't have to move. I would make the pedal with a hinge on the outside, with legs which either folding into the sides of the pedal, or laid flush. When the legs are unfolded, a system could be added to lock the pedal and prevent it from spinning. But the how well it would work depends on bottom bracket height, crank length, etc.