Need help with this script - similar to Freehand 521

This one has me stumped, as scripts sometimes will do. Any help would be greatly appreciated. Thanks folks.

Bill