A script could certainly be created. the rest sounds like an issue with the image size vs. DPI, so start by checking that at least the DPI are consistent.
Have you tried the vanishing point filter?
Add an empty layer
With that empty layer selected, Go to Filter vanishing point
Add a grid square to the page then use the ruler in vanishing point.
You can add measurement lines with the length and angle shown then render them back to Photoshop
The measurements will be rendered to the empty layer
Interesting point on the vanishing point. I am having a few issues with it though.
- I would prefer not to have degrees, this isn't so bad but I would prefer not to have it for my application as angles are meaningless.
- When I render measurements to Photoshop it is using 4 point font. I need to figure out where to change the text size. It also isn't obvious how I can add measurement units.
- It does not seem to be correctly applying my scale. It seems that if I set the grid size correctly this issue may go away.
Here is a side by side photo I made using my previous (tedius) method and vanishing point. The scale bar tool certainly does make more professional looking measurements.
Fair comment - it was just a thought
It looks like you may need to go down the scripting route