Straighten UV Border Script

I would like something that can straighten the UV Borders to the nearest vertical/horizontal angle.
This mainly for the purpose of lightmaps.

See attached image for what i'm looking for.

Would be much appreciated,
thx

AttachmentSize
uvborderstraighten.gif39.34 KB