Yes, it's a simple idea. And the reality is even simpler; they don't owe each other those amounts. Rather, a large number of individuals are owed those amounts. If I, a private individual, own a $1k bond issued by Portugal, and you owe a $1k bond issued by Ireland, obviously we can't just say that sums to zero. Nor can we do so even if I happen to be in Ireland and you happen to be in Portugal.
This whole thing is a non-starter, grounded on the most absurd assumptions with no bearing on reality. If we're just going to make things up, why not just assume that all interest rates are zero; now the debt burden is totally manageable.