Actually, he used the word “women” instead of “sexual relationships,” but he was writing for an audience of male monastics. He must have known that nuns would also read or hear this, but perhaps he assumed that in 13th century China, nuns would be less likely to get themselves into trouble over issues of sexual desire. Or perhaps stating the issue outright was seen as vulgar.
Although Ya-un was writing for monastics, I think this has to be read as a caution about unhindered desire, and in that sense, it applies to everyone.
There is nothing more disruptive to the body than sexual behavior (again, it was “women” here), and nothing more detrimental to spiritual practice than wealth. Thus the Buddha set forth the precepts, and admonished practitioners to avoid wealth and sexual behavior, saying, “If you see beautiful women, treat them as you would poisonous snakes or tigers. If you come near gold or jade, look upon it as you would a rock or piece of wood.” Even if you are completely alone in a dark room, behave as if you were in front of an important guest.
Behave the same whether you are seen or not, and let your speech and thought be in accord. If your mind is pure, all good spirits will protect you. However, if you yearn for women, Heaven [i] will not tolerate you. If good spirits protect you, then you will not experience any difficulties, no matter how harsh the environment. If Heaven does not tolerate you, then you will not be at ease even in an outwardly peaceful place.
Greed and lust are the gates of Yama’s hell,
purity of mind and action lead to
the paradise of Amitabha Buddha
Enter hell and you’ll experience a
thousand kinds of suffering.
and you’ll experience a
thousand kinds of happiness.