Jim,
I'm not familar with the Yanmar, but thought I'd throw my .02 out about fluid contamination in general.
As hydraman mentioned, it could be just air bubbles, or it could be normal condensation that's build up over the years cause nobody but us tractor fanatics change the fluid. If it was a grey market tractor, it could of spent a lot of time in a rice field, and you could be draining genuine Japanese water out of there.
If the stuff that you drained out is still around, you can check it after it's sit for a couple of days to get an idea of what's going on. Air bubbles will disperse by themselves. Water doesn't mix with the oil, it just gets dispersed, and it is heavier then oil, so it will settle out over time to the bottom of the container.
You didn't mention any green color, and I'm assuming the tractor doesn't have a trans cooler that interfaces with the engine cooling system, so the water must of come from outside.
Check the vent for the trans, make sure the factory shield is in place.
As to how much damage may of occured, that's hard to say. My general experience is that unless an appreciable amount of water settles out, the tractor will handle it ok. The fact that it sounds normal is a good sign.
Two examples from personal experience can illustrate the extremes of what can happen.
I had an old Farmall 400 tractor that came to me with milky fluid in the trans. I drained the fluid and noticed a few months later it was milky again. I drained it again, and it got milky again. It spent it's storage time out in the weather (had too), and I never could find where the rain water was leaking into the trans. But, frankly, I never spent much time looking either. This was a tractor that was on it's last legs in a lot of areas, and I wasn't going to spend a lot of time fixing something that wasn't completely broke. I would occasionally loosen the drain plug before operating the tractor and let any water drain out and go on my way. The trans never gave me any trouble, unlike many other parts of the tractor.
On the other hand. My dozer uses a cooler for the powershift trans located below the radiator that interfaces with the engine coolant. This cooler developed an internal leak and dumped about 4 gallons of antifreeze into the trans before I noticed anything. I actually noticed increased whine from the plantenary gears of the trans before anything else. Then saw the unusually high coolant temp and shut it down. But the damage was already done. The trans pressure is now about 20 psi less then it was before, and the whine stayed. The trans still operates fine otherwise, but I suspect I shortened it's life by 30-50%.
In your case I would just drain it out, check the trans vent, and then just keep a watch on it for a while. Probably it was just a case of poor maintenance by the previous owners that you caught in time.
HTH,
Dave