Ads in ebooks have several problems.
1) Portable ebook readers with small screens don't allow for non-annoying ads. Doesn't matter if they're text-based or not; a business-card sized ad is almost half a page on a 6" reader's screen, and that drastically disrupts the flow of the book. (Unless, of course, you put it at the beginning or end, where it'll be ignored.)
2) Different viewing technology means advertisers have no choice/control over how their ads are seen. I read on a PRS-505--color ads are wasted on me, and blinkies won't work. But people reading on an iPad could see full-color animations embedded in their ePubs.
3) The connection between "advertisement" and "sales" is always a bit thin, and you'd need some really impressive marketing to get ads in books to lead to sales of anything that's not other books. And the demographics for people who read ebooks, other than the romance/erotica genre, is too diverse to target for most ad companies. People who read ebooks of Twilight and Dan Brown aren't the same people who read the pbooks; ads aimed at the pbook crowd aren't as likely to work.
4) That ad-stripping script will go active about eight minutes after the first ad-laden books hits the digital shelves, and publishers and advertisers will scream themselves blue about how *that* is what's killing all their profits... not the fact that most people are going to ignore the ads they see in books.