John is *EXACTLY* right, and this is why, a month or so ago, I questioned your overall goal as well as the approach you have chosen. If you were still in school, I could understand why you might be doing such a project (eg, for a class or a thesis), but you replied that you have been in practice for 8 years. You should have more than enough revenue from your practice to purchase any of the clinically validated and widely accepted commercial software and write it off as a business expense instead of attempting to do it yourself.
If, for some reason unknown to us (eg, you don't like any of the commercial packages and think you can do better than the commercial software), then, because this is obviously a significant software development effort and you are clearly not an expert in the area of software development, you should hire some people who do have expertise in this, eg, a SW architect / manager, as well as people with expertise in mathematical algorithms, lighting and image capture, programmers/coders, etc., instead of pressing people for hours and hours of free consulting from on-line forums such as this. Some of these positions could be filled by part-timers and consultants at very reasonable rates.
Finally, let me be more direct than John: Photoshop IS clearly the wrong way to develop such software. At best, even using all the actions you have already developed and possibly some new scripts, the native programming capabilities of PS are much too limited and the end result will be too fragile, not capable of displaying the desired info without a huge amount of intricate (and easily broken) code, etc. At the very minimum, you should be looking into platforms such as ImageJ, or even more preferably, development platforms such as the Image Processing Toolbox for Matlab from Mathworks. This latter (or similar add-on "packages" for Mathematica) could then serve as a prototype for real software which would likely be written in an even lower level programming language such as Java, C++, etc.
Sincerely,
Tom M
PS - In some of our earliest communications, I described to you the benefits of a color space other than RGB, and suggested Lab, HSL/HSV, or any of several other possibilities that would allow one to substantially ease the lighting requirements, particularly with respect to shadowing, glints, and other unwanted variations in brightness.