A while back I seen a script for XP that would only allow the event to walk in while set on random movement in a certain are, like move within the 5 tiles but don't walk out of them. I was wondering if VX had anything like that...
You could always mark off an area using invisible events.
Well, you could always make it faux-random. As in:
Move Left
Move Down
Move Up
Move Left
Move Down
Move Down
Move Right
Move Up
Move Right
Move Up
That would look random, but ultimately you control it so that it never goes out of bounds and it ends up at the starting point and repeats. You'd probably need to make it longer so that it wouldn't be obvious to the player that it's not actually random.
Alternatively, my Advanced Areas script allows you to confine events within areas: http://rmrk.net/index.php/topic,25247.0.html.
In that one, you can specify which areas the event can move around in, and it will be prevented from ever venturing outside those boundaries.
You can also restrict events to certain terrain tags using this script: http://pastebin.com/VqrchC9S
*hugs*