In general, you can apply equations like this in ENVI using Band Math. See the docs for Band Math here:
http://www.harrisgeospati...BandMath.html#Enter.
You will need to use conditional operators ("gt" for greater than, etc.) to determine which pixels meet which criteria for one equation. If you need to use several lines of IDL code to get the whole algorithm implemented, you can form that into an IDL function. If you then put that function into your ENVI or IDL path (for example, by putting it in the ENVI save_add directory), IDL will restore it when ENVI starts. It will then be available for you to call as part of your Band Math expression.
Regards,
Peg