It is quite complicated. The examples I gave are quite simple, but in a lot of cases the transpositions can happen many moves into the game. The maroczy sicilian example I referred to is one of these cases, where I might not actually play e4 until say move 8-10, but in a general sense it probably should be classified as an e4 opening.
As an overall guide I think what you have done is fine, but I suspect something in the order of 10-20% of games might be subject to transpositions where the opening move isn't an accurate categorization.