I looked in to this a bit and discovered that depending on your uptime you get around five or six different formats on the output from '/usr/bin/uptime'. I then tried to fix the script, but parsing this via AppleScript and shell scripts is very cumbersome.
I'm not sure how people are using this script, but I would suggest returning the output from the uptime command more directly, though the format may then vary.