Finder list view, change column with to optimal with using AppleScript
Solution 1:
The only thing that I can think of off the top of my head would be to get a list of the items in the current folder, find the item with the longest name, and then resize the width per that value. That's really all that's happening with the optimal width double-click.