My theory is that Ishamael is one of the servants of the wheel who get spun out of tel'aranrhiod periodically in order to set great events in motion, events needed for the correct turnings of the wheel of time. So in my mind, Ishamael's physical body was trapped along with the others, but his soul was allowed to roam tel'aranrhiod and spin out periodically. The wheel really isn't good or evil. It's a combination of both. The wheel is a manifestion of law/order. So it stands to rights that some of the "heroes of the horn" (or servants of the wheel) must set in motion evil deeds periodically for destiny's true course to be accomplished. And I believe at a book signing, RJ did state that Ishamael was partially trapped and would get "spun out" periodically from his prison. "Spun" is not a word used often in regular conversation. I believe it refers to the fabric of the wheel of time in which Ishamael's soul would be a thread. It getting spun out for a specific purpose would imply that he is one of the servants of the wheel.
Now take a look at one of Ishamael's speaches in the beginning prologue of the original book.
"Ten years, Betrayer," Lews Therin said softly, the soft sound of steel being bared. "Ten years your foul master has wracked the world. And now this. I will ...."
"Ten years! You pitiful fool! This war has not lasted ten years, but since the beginning of time. You and I have fought a thousand battles with the turning of the Wheel, a thousand times a thousand, and we will fight until time dies and the Shadow is trumphant!" He finished in a shout, with a raised fist, and it was Lews Therin's turn to pull back, breath catching at the glow in the Betrayer's eyes."
This is just one passage where Ishamael implies a great knowledge of his own past lives. However, in the Wheel of Time, most everyone only has memories of their current life. It is a very rare instance when a person can remember more than just that. Our only examples are when the Dragon self-actualizes in book 13, and when Birgitte's soul is ripped directly from tel'aranrhiod into reality by Elayne as she attempts to save Birgitte's life. Birgitte remembered all her past lives in tel'aranrhiod, and she still remembered alot when reborn in this fashion with the memories fading/disappearing as months went by. The Dragon is also a servant of the Wheel. That's why Artur Hawkwing was able to recognize him at Falme. (Incidentally, IMO that's why Perrin was allowed to fight with the other heroes in the van since he too is a servant of the wheel that Artur Hawkwing recognized)
My point boils down to this. If Ishamael was partially trapped with his soul free to roam tel'aranrhiod and get spun out periodically by the Wheel, then he would have access to all those past memories of his past lives. That explains where his knowledge comes from. It explains his partial imprisonment. It explains why in most cases he wants to turn the Dragon to the Shadow rather than kill him. He is a servant of the Wheel.
Now take a look at one of Ishamael's speaches in the beginning prologue of the original book.
"Ten years, Betrayer," Lews Therin said softly, the soft sound of steel being bared. "Ten years your foul master has wracked the world. And now this. I will ...."
"Ten years! You pitiful fool! This war has not lasted ten years, but since the beginning of time. You and I have fought a thousand battles with the turning of the Wheel, a thousand times a thousand, and we will fight until time dies and the Shadow is trumphant!" He finished in a shout, with a raised fist, and it was Lews Therin's turn to pull back, breath catching at the glow in the Betrayer's eyes."
This is just one passage where Ishamael implies a great knowledge of his own past lives. However, in the Wheel of Time, most everyone only has memories of their current life. It is a very rare instance when a person can remember more than just that. Our only examples are when the Dragon self-actualizes in book 13, and when Birgitte's soul is ripped directly from tel'aranrhiod into reality by Elayne as she attempts to save Birgitte's life. Birgitte remembered all her past lives in tel'aranrhiod, and she still remembered alot when reborn in this fashion with the memories fading/disappearing as months went by. The Dragon is also a servant of the Wheel. That's why Artur Hawkwing was able to recognize him at Falme. (Incidentally, IMO that's why Perrin was allowed to fight with the other heroes in the van since he too is a servant of the wheel that Artur Hawkwing recognized)
My point boils down to this. If Ishamael was partially trapped with his soul free to roam tel'aranrhiod and get spun out periodically by the Wheel, then he would have access to all those past memories of his past lives. That explains where his knowledge comes from. It explains his partial imprisonment. It explains why in most cases he wants to turn the Dragon to the Shadow rather than kill him. He is a servant of the Wheel.