The way I see it the flaw is in the first sentence of the "example":
> Assume the amount in my selected envelope is $20.
You can't just pull that assumption out of your ass. You can only assume what the problem states, which is that the values in the envelopes are X and 2X and you had a 50% chance of choosing either.
If you run the math without adding assumptions, it works out that swapping makes no difference, statistically.
Though it is a very clever trick :).