If you do decide to make "Friendly" persist with the alliance TG scene, replacing the old
if ree_at != "Engaged":
with
if ree_at != "Engaged" and ree_at != "Friendly" or ree_at != "Friendly" and ree_at != "Engaged":
seems to have worked. Don't know python so maybe there's a better way, but I tested it by discussing alliance and TG'ing him at both "Friendly" and "Wary". "Friendly" stayed, but "Wary" became "Trusted" with my code.