I tried making it happen in 21 blocks, but there was a bug so oh well. More compact looking solution, though.
This could be a terminating solution with 24 blocks. Thanks to @MartinBraendli2 for the original solution, but I saved 2 blocks by making it non-terminating and compacted the script.