The problem with deciding whether leaving a group is justified or not is because in this game the 30 minute penalty is automatic. You leave a full party and you get the penalty. The only way to possibly get around that is talking to a GM and I doubt they would have the time or the manpower to talk to the many people who leave a party and determine whether it was justified or not. Even if they added a pop-up menu where you had to give a reason for your decision to leave, it would be really easy to lie about it.

In the case of harassment, all one can do is leave and report them. Some people will kick a party member first in order to leave without penalty, but that counts as abuse of the vote kick feature and can also incur a penalty if you are reported.

On the other hand, if you're stuck in a group that cannot clear content because of a lack of skill, then there is the option to vote abandon. Other than that, there really aren't many other ways to avoid the penalty (at least that SE approves of).