Portage 1.8.9 takes values from its cache, not from the (changed) ebuild, even though the ebuild's mtime is newer (I checked). This occurs about 75% of the time, with all ebuilds, is fully reproducible here.
Totally not reproducible here :/
Well, it's happening here, and it's really unpleasant. I don't know python, or I'd try to trace it myself. Could you please add some verbose output lines around the mtime comparison? Something like printing "comparing a with b, a's mtime is this, b's mtime is that, therefore choosing this."