When referring to a grouping, you can use the singular. In this song, the target of the verb is seven, not years. This can be a single amount, seven, and can use a singular verb. Measurements are usually referred to as a total group, and use the singular.
This is rarely important except when the group has properties that the single units do not. Example:
7 is the correct amount. - The correct amount is 7. Any single unit would be incorrect.
7 are the correct amount. - Of the amounts, 7 of them are the correct amount. There may be other amounts which are not the correct size or number.
The (American) football field is 100 yards long.
Ten yards is a first down. - Any 10 yards together make a first down. This is correct.
Ten yards are a first down. - 10 of the 100 yards are each a first down. The other 90 are not. This is not correct.
So in this song, the author could have used either "has" or "have".