It's not so hard really. There are a few ways you can go about this:
Instead of using rect.Top, rect.Left, etc. to loop through and get your min/max data, use 0 and src.Width to loop through the entire src canvas. On the plus side, it will work in CodeLab. On the negative side, it will be VERY slow because you will have to calculate it once for each ROI.
Probably better to switch away from CodeLab at this point. But, before you do, build your effect into a DLL and check the "View source" check box on the build dll screen. When your source is shown, select all the code and copy it to a new text document (use notepad) and call it effect.cs (or whatever your effect name is, plus the ".cs" at the end). Once you have the new file, add a few class variables to hold the min and max values. Then, edit the OnSetRenderInfo function and calculate your min/max values there. Finally, just use them in your render function as you would any other Amount1... variable. This will cause your min/max calculation only to be run once--well, once each time a UI control is changed.
Here is an effect that I basically did the same thing: http://paintdotnet.forumer.com/viewtopic.php?f=16&t=26579 I had to call the cloud effect in the OnSetRenderInfo function.
If you don't want to download Microsoft's Visual Studio Express (free) you can always use the command line C# compiler you already have on your system. Your source code's first line includes the command line options that you need to use in order to compile it.
Let me know if you need any more help.