It sounds like you're asking how to do a while loop which performs a test and waits until the condition has fulfilled. I don't think the fact that you're doing it in an automated test or not really matters. In either case, assuming something is going on in the background thread which will eventually make the two PixelMaps return true on Compare:
while( !expected.Compare(actual, 5.0))
{
const int numberOfMillisecondsToSleep = 1000;
System.Threading.Thread.Sleep(numberOfMillisecondsToSleep);
}
I don't fully understand the context of the question and this assumes that if you sleep the condition will eventually be fulfilled. If not, this is an endless loop, so be careful.