Okay, whatever.
I was about to note that the whole thing can be done without using explicit edgemasking at all, as can been seen in the SeeSaw script.
But since you did
not want to know
"which script already has it", I respect you wish and won't mention it.
You just reflect about possible relations between "edge magnitude" and "sharpening difference", then you'll surely discover it by yourself.
__________________
- We´re at the beginning of the end of mankind´s childhood -
My little
flickr gallery. (Yes indeed, I do have hobbies other than digital video!)