Hey Man, can't you use 2 local variables to work for you?
(I'm also working on some Zelda style game, haven't tried this yet though)
One variable we call "Time" and the other "Direction".
You just remove X*dt from "Time" every second and when it hits 0 you call a event that sets "Direction" to random.
Then you determine the AI direction by the number you get with a event:
If 0 go UP / If 1 go DOWN... ETC!
Set "Time" to a something above 0 again. (perhaps a Random number for variety?).. and repeat!
Just an idea I just had.. I will also try it out!