'If/else' statement inside 'nav' tag
Short answer, it can't be done. I'm not sure why, but it's some sort of conflict with how nav, children, and ifchildren operates.

The workaround is ugly (but it works). Just use two separate, but identical if statements... one before the ifchildren, and one after.

{% if comment.isFlagged() == false %}
    ...
{% endif %}
{% ifchildren %}
    ...
{% endifchildren %}
{% if comment.isFlagged() == false %}
    ...
{% endif %}


EDIT:

If this solution doesn't work for you, I recommend looping over the comments array and removing all flagged comments before you run it through the nav loop.