I have had WiFi problems for several months but as it turned out it wasn't a software (OS X lion) but a router problem.
It wasn't a connection loss with the router but the iMac lost connection to the internet.
Maybe my sollution is applicable for more OS X lion and iMac(intel) users.
Many routers can send a mixed WiFi signal like B,G and/or N.
The mid 2011 iMac can recieve both G and N WiFi signals but when a router switches all the time between G and N it gets "confused".
The sollution for my iMac:
My router was programmed to send a mixed WiFi signal (G and N ) on a mixed frequency (20 to 40 Mhz)
I changed that to a fixed N wifi signal and fixed frequency.
Further more I checked which WiFi channels my neigbours where using and changed mine into a channel that was at least 2 channels different than the one from my clossest neighbours.
I hope this will help some of you.
There is only one thing that I realy have to say.
The iCentre's here in Holland suck.
I have absolutly no confidence in their skils.
They tried to convince me that setting my IP adress on manual was responsible for this problem and charged me Euro 79,- to change that into an automatic IP adress because software issues aren't covered by the standard warrenty on a almost new iMac.
Last weekend Europes biggest Apple store in Amsterdam opened its doors and hopefully they will do a better job in the future.
Also I think that the people at Apple can do a much better job in providing sollutions even when it is not directly related to one of their products.