Hmm it's close but not exactly what I'm going for. Basically the eggs copy Yoshi's movements down to the pixel but with a small delay. The higher the egg ID, the longer the delay, creating a sort of trail.
Here's a clip of it
I prefer this because there's no complex pathfinding accounting for the player's various movement types, risk of the follower getting stuck, etc.
I've read about using an array like LittleStain mentioned but haven't tried it myself. I'll give it a shot.