The cranks would lock with a ratchet mechanism inside the pedal spindle. This could lock into place when you twist it to the “kickstand” position and would engage a spring-loaded pin that prevents the crank from rotating.
I think the proper locking angle and a rubberized foot on the pedal would make it as secure as a normal kickstand.