Cod is an interesting word. It means a sac or bag (as in peasecod, ie pea pod) and also a cushion or pillow. It's also a slang word (from medieval times) for the scrotum. So the song has a pun. The lassie could lie down on his nice little pillow, or on his scrotum!