A script like that DOES exist somewhere. I remember it in a Lufia context (a game that had this kind of system way before Grandia, by the way), meaning it might be in conjunction with an enemies-only-move-when-player-does-system. That was years ago, however, so while probably still slacking somewhere in .org's database, I don't feel like wasting my lunch break right now to do that ^^ But I hope I gave ya enough information for you to find it by yourself.
Regardless of that... you'Re a scripter, aren't you? Why being lazy and look for it while you can easily do it yourself, learn something from it, and be guaranteedly better than whatever another person did back in RMXP stoneage (where expert's scripts were even worse than the average noob's one nowadays).