How can you unblock a building when a player change alliance?
That's possible. You can have it from easy to difficult
When you know the player ID at the start (like in singleplayer) then it's easy.
At the match beginning, you check States.PlayerAllianceCheck(yourID, otherID) and store it to a global variable.
Then during the match, you do a ' if States.PlayerAllianceCheck(yourID, otherID) <> StoredVariable then Actions.HouseAllow(yourID,houseID,true);
When you don't know the player ID (which is the case in multiplayer maps) then you have do a for-loop over all positions and store the results in an array.
Then during the match, you will do the same as above, but again in a for-loop over all locations and compare it to the stored array. The difficulty here lies in the fact, that you have to skip the self-reference-check where yourID = for-loop-variable, otherwise this will always be true and your house will be unlocked from the beginning.
But after all - since you can't change alliances during game but only with dynamic scripts, I'd do it in a much simpler way:
you write a function that does both - the alliance change and at the same time the house unblocking. No difficulty there.