I honestly wish they had some of that level of scripting for the desktop version too, I love the idea of doing Python with Minecraft. Plus fun ideas like that could scale a little better on a much more powered system.
It may be a little outdated (works with minecraft 1.7), but this project replicates the pi functionality for the normal version of minecraft: https://github.com/kbsriram/mcpiapi
https://minecraft.makecode.com/
It's a scratch like programming environment that lets you do all kinds of cool things in Minecraft.