What you want is impossible. ActionScript is not multithreaded, so it has no way in the middle of executing code to "know" when it's time to render the next frame. Event handler code runs to completion, always. It's the responsibility of the programmer to ensure that event handlers don't run for too long.
The only solution to your problem is to do less processing each frame. For example determine how many pixels can be processed before slowdown occurs (bearing in mind that this limit will be different for different users), then limit your loop to processing that many pixels at a time, perhaps iteratively processing the entire bitmap, or randomly selecting pixels instead. If you wanted to get really fancy you could include a benchmarking algorithm to automatically determine what the upper limit is on any particular system before processing time exceeds the frame rate.
Also your randomHex() function can be completely replaced with Math.random()*16777215. That should speed things up a bit. Saving a local reference to bmp.bitmapData.width and height in the update function instead of looking it up every single time through the loop should also be faster.