1. We simulate a million trials where the contestant chooses one of three door, one of which has a car and two a goat
2. We simulate the host randomly choosing one of the remaining doors to open.
3. We discard all trials that resulted in a car. We are left with the number of trials that resulted in a goat and store that number in a variable 'total'
4. In the remaining trails we switch and reveal what was behind the door. We store the number of times we saw a car in a variable called 'wins'.
5. The probability of winning after switching is 'wins' / 'total'
It doesn't matter how many times the host shows a car because those trials are discarded.
You don't need to because you're asking what is the probability of winning by switching once the goat has been revealed. We want to know:
(# of possible worlds in which we win after switching) / (all possible worlds in which we are shown a goat after the initial pick)
vs
(# of possible worlds in which we win without switching) / (all possible worlds in which we are shown a goat after the initial pick)
in this case 2/3 vs 1/3. We are only considering the cases where a goat has been shown so what happens when a goat isn't shown or what the host's intentions are when a goat is show is irrelevant.
I've written the simulation, and you're right. It is 50% when the host chooses randomly!