"Came undone" in this context?
The hair is what came undone. In this case "undone" is the past participle of "undo". This is the opposite of "do", in the sense of "doing one's hair", meaning to style one's hair.
Therefore, the listener is being invited to consider what activities might cause one's hair to become messy after they've taken the time to style it...
To understand songs from this era you have to understand the censorship of the time. Songs could not be explicit - any sexual meaning had to be very guarded and ambiguous.
So the lines
It was a very good year for city girls, Who lived up the stairs,
establish that there was a girl who lived upstairs from him.
And then the ambiguous lines
With perfumed hair, That came undone,
The straightforward meaning is that the girl's hair came undone, during (as it was called at that time) petting.
The more ambiguous meaning comes from the possibility in the listener's mind that the word undone applies to the girl, not the hair. With this interpretation, the lines mean that it was a very good year because he had sex with the girl upstairs.
Such subtlety is common on songs from the 1950's, and had declined markedly by the 1990's. It appears to be becoming more common in the last few years.
It's the hair which is coming undone, a reference to "letting your hair down", which could be a euphemism for being affectionate or intimate, but in general, relaxed.
"With perfumed hair, that came undone, when I was twenty-one".
When a young man takes a girl out for a date, her hair is usually arranged in some fashionable way, which may have taken her some time to do. After a few kisses, however, it comes undone. Easy to get the picture.