I think the least confusing solution would be, if your team is able to score as long as their own flag is at the base.
Having the possibility to score depend on which team has captured your own flag would only introduce chaos as I don't think anyone can keep track of all the rules that would come with that.
Speaking about options, anther option could be to limit the number of flags each team can capture at a time. For example, if this limit is set to 2 and the red team has the blue and green flag, it will not be able to capture the yellow flag until one of the other two flags is either lost or 'brought home'.
__________________
|