Cute New iTunes track Property
It's loved:
tell application "iTunes"
set sel to selection
repeat with aTrack in sel
try
set aTrack's loved to true -- or false if un-loved
end try
end repeat
end tell
The playlist also has a loved property. track also has album loved.
UPDATE: Unfortunately, current track and current playlist are broken for Apple Music tracks. So changing the loved property of a playing Apple Music track can't be done.