While the dialogue in the book (Half-Blood Prince, chapter The lightning-struck tower) is generally similar, Dumbledore does not speak of “a boy who made all the wrong choices” there. Here is the relevant part; I highlighted the sentences directly corresponding to the film dialogue in bold:
‘So let us discuss your options, Draco.’
‘My options!’ said Malfoy loudly. ‘I’m standing here with a wand – I’m about to kill you –’
‘My dear boy, let us have no more pretence about that. If you were going to kill me, you would have done it when you first Disarmed me, you would not have stopped for this pleasant chat about ways and means.’
‘I haven’t got any options!’ said Malfoy, and he was suddenly as white as Dumbledore. ‘I’ve got to do it! He’ll kill me! He’ll kill my whole family!‘
‘I appreciate the difficulty of your position,’ said Dumbledore. (…) ‘I can help you, Draco.’
‘No, you can’t,’ said Malfoy, his wand hand shaking very badly indeed. ‘Nobody can. He told me to do it or he’ll kill me. I’ve got no choice.’
‘Come over to the right side, Draco, and we can hide you more completely than you can possibly imagine. (…) come over to the right side, Draco … you are not a killer …’
Malfoy stared at Dumbledore.
So the line about the boy Dumbledore used to know is probably by Steve Kloves, who wrote the screenplay for all the films except Order of the Phoenix.
Now for the question who film-Dumbledore was referring to. There are already answers arguing that it definitely was Tom Riddle, it definitely was Dumbledore himself, and it definitely was either Tom Riddle or Grindelwald; from this, I am confident to state that the reference is ambiguous and giving an answer with certainty is impossible.
Still, I can speculate about some candidates. To me “all the wrong choices” sounds like a kind of slippery slope where someone repeatedly makes bad decisions that go counter to his actual goal. This would fit very well with Snape, who – in spite of his deep love to Lily – made a number of choices that increasingly estranged her. It would also fit with Dumbledore, who strived for “the Greater Good”. However, it does not at all fit with Tom Riddle, who set himself evil goals once, then mostly made the right choices (from his point of view), consistent with his goals.