So I sat down and worked out this AppleScript...
tell application "iTunes"
set thePlaylist to library playlist 1
set musicFiles to the file tracks of thePlaylist
repeat with mf in musicFiles
--the name of mf as string
set hasLoc to ""
if (the location of mf as string ¬
is equal to "missing value") then
try
set comment of mf to the comment of mf & ""
on error number errNum
delete mf
end try
end if
end repeat
end tell
The script goes through the entire library looking for file tracks (stream tracks, for example) and first checks to see if the location of the file returns a missing value. If so, it then tries to append an empty string to the comment of the track (some file tracks return an empty value even though they aren't really empty). If that fails, the file is really missing and is deleted from the iTunes library. This is really the only option since iTunes cannot add a missing track to a playlist or alter the metadata for the track.
[robg adds: It should go without saying, but ... this script will delete things from your iTunes library. Hopefully only missing things, but in case something goes wrong, have you backed up lately?]

