This isn't quite right. Obviously if there's a chance Monty might open the car, it screws up the gameshow, but it doesn't actually change the odds in the situation that he opened a door with a goat.
The knowledge in Monte's head doesn't change the odds.
To simulate this properly, you'll need to change the problem statement somewhat... you'll either have to throw out cases where he opened the door with the car, or state the problem such that we're only look at cases where he randomly opened a door with the goat. But you'll still get 2/3.