I know what youre talking about, infact, Im already working on the same script, lol. Ive got the level set up and everything...but, its hard as anything to start it off. I used 3 different images. 1, the head, 2, the body parts, and 3, the tail.
Then, you need to set a timeout for it to move. When its a timeout, I used the move command. Place onwalls in needed areas, apply the images to the right spots, have random values for moving, and youre basically started.
That is just for the head. Next, you might want to add level.vars for the body parts, since as far as i know, there is no "follownpc" command. so, you would use a showimg for the body and tail, based on the position of the worm. Or, you could use actual NPCs to do this. I'd post my script, but it isnt finished. When it is, Ill let ya have it

.
(Sry if this doesnt make any sence)
Okay, here im gonna break it down....
!head npc
-timeout times
--move command
---random value from -2,3 for level.movex
---random value from -2,3 for level.movey
--- speed in which its moved
--- options (use onwall option)
--Showing image based on value of random level.movex,y.
--level.bodyx for body
--level.bodyy for body
--Player involvement commands (such as washit, touchsme ect)
!body
-timeout times
--x=proper position based on level.bodyx
--y=proper position based on level.bodyy
--player involvement
!tail
----Same as body
--hearts=level.hearts
!All
-timeout times
--if clause when level.hearts=0.
---hide
---set flag
Its not exactly code, its an outline
