It depends on the bike. If you have a brand new bike and lay it down, cosmeticaly it will cost a couple grand, but they won't total it if that's all that is wrong with it. On the other hand if you have an older bike and do this, they are going to total it because it isn't worth it to fix it. Most people that file insurance claims would have newer bikes rather than older. I've also seen bikes that look fine but the frame has a ding in it and so it is automatically totalled because it would cost too much in labor to rebuild onto the new frame.
Bikewer is right, you have to watch what you buy and make sure you check the title to see that it doesn't have a "salvaged title". Salvaged bikes are fine as long as they are repaired correctly and you know what you are getting into. But they are tough to resell.
Some Truths Feel Uncomfortable.