This is a really interesting idea! I have one suggestion though - in running a few random songs through the code I found I sometimes needed to change the DATALINES statement in the data step to DATALINES4 as the punctuation in some lyrics can cause issues otherwise.

I also wondered whether it would be possible to determine merely from the pattern what genre of song (or what artist) was being processed - for example could you tell a rap number from a Mowtown song or distinguish between Eminem and Dr Dre merely by the pattern or repetition score? This may be asking to much of the concept but it could be an interesting project...