A possible use for the custom script could be to customize the words/format that are returned. $duration returns the words in a specific order and with specific words inserted. The custom script could be changed so the output was, for example: "4w3d 5hours 8minutes 6seconds" if the weeks and days were less important than the time or "6seconds 8minutes 5hours" if the user wanted the time in a different order.
-genius_at_work