I'm working on creating a minigame that uses baseplates to generate infinite terrain. I'd like it so that when you step on the baseplate that isn't completely surrounded by 2 layers of baseplates, it'll generate the missing plates. Here are some pics to help explain. I'm sorry about the quality, I didn't realize how small the images were when I made them.
The player starts on the purple square:

When the player moves to the square to the right of the purple square, the script would generate the 3 blue squares.

I'm not really sure where to begin as I'm pretty much completely new to scripting.