Yes indeed, I image it's complicated! 😅
Can't you do something with A* path finding and you give higher bias to dangerous spots on the road (so it naturally try to avoid it if possible) ?
yes, I think you’d need some kind of A* that allows to backtrack once you reached certain points of interest, taking into account that you cannot have over 3 hearts, that monsters disappear when killed with a sword, etc.
Some people can probably do this in a few minutes, but it’s not something I would tackle in a 48h game jam :p