Time to take it in. This is most likely going to be an issue with the logic board, though Logitech is known for putting out some rather craptacular drivers. I wouldn't think a keyboard would do it, but as a test it probably couldn't hurt to remove the Logitech software for a short time to see if that has any effect. If not, then I'd take it in to get it looked at. Odds are the MLB will get replaced.
If you have AppleCare, you can request an on-site repair, where they send someone to you, but if it's just limited warranty you have to take it to either an AASP or Apple Store. Personally I'd go with the AASP. A lot of times they're closer, less crowded (and iMacs can be kind of bulky, so trying to make your way through a crowd of people carrying one is just tempting the fates), and usually AASPs hire techs based more on skill than personality, which isn't true for Apple's stores. As an added bonus, you're helping support a small local business. If they have to replace any parts, your warranty will pick up the tab whether it's an AASP or Apple Store.
I have an iMac with all the bells and whistles running Lion. I currently have a logitech G110 gaming keyboard attached and a generic trackball both of which are corded. I have a tardis usb hub plugged in to the iMac as well as the keyboard and mouse. When ever the computer goes to sleep I have to do a forced boot to wake it up.
Now I've tried disconnecting the USB hub without it making a difference. However when I switched back to the yucky keyboard apple provided it would only occasionally wake up the computer but not consistently.
I'm desparate for suggestions here so any ideas would be welcome.