Maxscript - UV pixel padding

Hi guys!
I need help to figure out how to write a script that add border and pixel padding (based on resolution) between the uv elements in unwrap uvw modifier without to normalize the size of the elements.

There is a one script - http://www.scriptspot.com/3ds-max/scripts/pixelpack which works almost like I want but it strangely does not take the "Normalize>off" in account and it change the original size of the elements. (I tried to contact the author of this script but I didn't got any answer from him) :(

I tried to find out eventually how he did the whole pixel packing thing and I failed (still not very adept with maxscript)
What is the logic he is using in his script?

Thanks in advance.

Cheers.