Vertical double pistons are always a bit tricky. Here now is a solution that you can also build in a row up to 15 times in a row.
My goal was to build a simple double piston that is flat in the ceiling/floor and expandable.
Instructions:
Here's the one from the ground:
Brown=Input
Light blue=extend
Orange=Run in
Here's the one from the ceiling:

Stone steps=Input
Pink=exit
Blue=retract
Here are a few more pictures of how to go overboard with it:
The 15x4 gate:


The technique behind it (same as above):

That goal is awesome!
Cool idea, unfortunately, that works with me with the bottom not at all. Extend everything OK, retract but does not go completely. Have it built exactly as in the picture, can it be that there is still some component that you can not see in the pictures? Would like to have such a large gate (6×4) as the main entrance to my castle wall 😉
@DjDope have built this in an older version, maybe it's because...should I look if I can build one in 1.10?