The books could come with cards that have a code on them. The code is beneath a scratch-off portion (like those scratch and win lottery tickets), so you'll be able to see if the code has been revealed (which likely means it's already been used). To discourage theft of the cards from the books they should be kept behind the counter and dispensed by the sales staff when a book is sold.
Alternately, it could work like getting a free game with purchase of a graphics card. The code is generated by the register and printed on a receipt. The purchaser then submits the code online and downloads the game.
I think your solution is interesting (especially the receipt one), but it doesn't deal with the four issues that Elfcrusher lined up:
1. Backwards compatibility with already printed/sold books? No, it would only work going forward. You could give codes to folks who purchased through an online retailer like Amazon. I remember when Amazon started giving mp3s alongside of CDs you purchased, I retroactively got access to some. However, I assure you that if they did that, it would be a PR nightmare from everyone who chose to support a FLGS and since Wizards incentivizes supporting the local store through early releases and special covers, they would be attacking their core consumer base. There's not a simple solution here.
2. Not require new technology or training? I'm pretty sure both of your approaches would fail this test. The cards would require training and the receipts would require new technology.
3. Not require expensive/complicated packaging to prevent theft? Both of your solutions solve this. The cards could even be like gift cards that have no value until activated.
4. Work with online retailers? I think neither of your solutions precludes an online solution. You can purchase digital game cards on Amazon that generate valid codes in the same way that can purchase physical game cards. The tech may not be plug and play, but I don't think it would be out of reach.
Personally, I think the biggest issue that folks have with the digital options are the cost. Most folks are willing to pay something. They just don't feel that cost to value is right for them yet especially if they already own the book(s). I understand that and I'm in the same boat. However, I will add that the fact that I do not place the same amount of value on a good as the seller does not give me the right to take that good for the value I want (whatever that value may be, including free). At best, I can wait and hold my money. If the cost of the good drops to a point where it meets my personal valuation, I purchase. If not, I don't. That's the best way that I can communicate my desires on the subject to the owner of the good.