I should've done more than hint at it, lol. Use paths.
I'll use a recreation of LttP's battle as a model.
Say we have Path_1: that gets created when the player enters the room, and then the Moldorm object follows the path. But what does Moldorm do after he finishes moving over Path_1? It would be boring if he followed the same path again and again.
New addition: Path_2. Path_2 also gets created when the player enters the room. Moldorm follows Path_1, and then Path_2, and repeats them both.
But that's still boring; the paths should be dynamically created as Moldorm moves! Now that's where it gets tricky, because in Game Maker we can't change our path resources while they're in use by the Moldorm object.
Luckily, we have two paths.
Both paths get created when the player enters the room, and then switched back and forth. When one path is in use, the other path gets rewritten, and vice versa.
The head of Moldorm will be using a new path, while one or more of his back segments might be using an old path. Including his head, he has 5 segments in total; let's say as an example that each segment switches paths every 60 frames (random number). The head switches first, and then the next segment, and so on. A segment is switching every 1/5 of the time (5 segments) so there's a segment switching every 12 frames, and that creates the effect that the segments are following one another.
Let's visualize this. All 5 segments start on top of each other. The head moves first; it's set to Path_1. Every 12 frames, another segment gets set to Path_1. After 48 frames, every segment has been set to Path_1. After another 12 frames, the head is set to Path_2. 48 frames after that, every segment has been set to Path_2. That's the time for Path_1 to be rewritten in a semi-random way -- you'll write the algorithm so that it creates the motion that you want it to. Then 12 frames later, the head segment swaps back to Path_1, etc. etc. and 48 frames after that, Path_2 has time to be rewritten, etc. etc. and that cycle continues until it dies or Link dies.
And that's how you'll do it.
Sounds easy, right?