Neither sentence sounds natural. The "it" at the end sounds as if it refers to the book (as it would in "this book is so interesting that I had read it three times before I lost it."), rather than "the fact that I had read it three times." I think what you want is something like "This book is so interesting that before I realized what I was doing, I had read it three times."
It may help you to think of until as meaning "continuously until", "without interruption until".
If you can add "continuously" or "without interruption" and your sentence still makes sense, you can use "until". If there is any action which finishes during the time period you are considering, you can't use "until".