No one really knows when one is coming out, all we have are the rumors. It could come out tomorrow, or next year, or never. All we know is that statistically, it is due.
As far as upgrades, if you buy an iMac now, you'll get that iMac. If an update comes out between when you purchase the iMac and the time it arrives at your home, you could return it and simply order a new one. If you buy it at an Apple Store, then you get whatever they have at the time.
If an update comes out within 14 days of your purchase, and you have not changed any of the default build options, you can return the iMac and purchase a new one, however, if the box has been opened, they will charge you a 10% restocking fee. If you purchase a computer with custom options from the apple store online, however, it is not returnable unless defective.