I just might bog down with over 1000 paths. It could take several minutes.
set myList to "POSIX path 1 -- Joe - line 1 of file
POSIX path 2 -- Moe - line 2 of file
POSIX path 3 -- Joe - line 3 of file
POSIX path 4 -- John - line 4 of file
POSIX path 5 -- Moe - line 5 of file
POSIX path 6 -- Steve - line 6 of file
POSIX path 7 -- apple - line 7 of file
POSIX path 8 -- pie - line 8 of file
POSIX path 9 -- Janet - line 9 of file
POSIX path 10 -- Caroline - line 10 of file
POSIX path 11 -- apple - line 11 of file"
set text item delimiters to return
set myList to every text item of myList
set newList to {}
set pathInfo to {pathName:"", occourances:{}}
set occourancesList to {}
repeat with x from 1 to the count of myList
set text item delimiters to "-"
set thisPath to text item 3 of item x of myList
if thisPath is not in newList then
set the end of newList to thisPath
set the end of occourancesList to {thisPath, {x}}
else
repeat with y from 1 to the count of occourancesList
if item 1 of item y of occourancesList = thisPath then
set the end of item 2 of item y of occourancesList to x
end if
end repeat
end if
end repeat
repeat with x from 1 to the count of occourancesList
set AppleScript's text item delimiters to ", "
set item 2 of item x of occourancesList to item 2 of item x of occourancesList as string
set AppleScript's text item delimiters to ": "
set item x of occourancesList to item x of occourancesList as string
end repeat
set AppleScript's text item delimiters to return
return occourancesList as string