Copy BPM & Star rating to Comments in itunes using Applescript
You want to grab the selection, which will be a list of tracks. Then, you use a repeat block to process each track in the list. Here's the script. You may want to adds checks to make sure iTunes is running, and some try blocks in case of failures:

tell application "iTunes"
    set selectedTracks to selection
    repeat with thisTrack in selectedTracks
        set theRating to rating of thisTrack
        set theBPM to bpm of thisTrack
        set theComment to "" &amp; (theRating / 20 as integer) &amp; " star | BPM: " &amp; theBPM
        set comment of thisTrack to theComment
    end repeat
end tell