The price at which a stock was purchased is a sunk cost--that is, you cannot go back in time and reverse the decision you made to purchase that stock. Another example of a sunk cost would be purchasing a non-refundable, non-transferable movie ticket. Sunk costs have the tendency to create a cognitive bias in which we feel that the amount we paid at some point in the past should have some sort of bearing on the decision we make now--the purchaser of the ticket feels he must go see the movie even if he no longer wishes too, lest the ticket "go to waste"... the investor hopelessly clings to a battered stock for that tiny chance that just maybe some day it will return to its former glory. This is referred to as the "sunk cost fallacy" and is considered to be irrational behavior by economists.
Keeping this in mind, your hopes and dreams for the stock at the time you purchased it should have no bearing on the decision you make now. Similarly, whether the stock has risen or fallen in price since your purchase date should have no bearing. Instead, you must consider what you expect the stock to do from this very moment on into the future--that is, you must act at the margin.
You've indicated that you are faced with two choices--sell the stock now, incur the loss, but benefit from the tax break (Option A). This benefit is quite easily quantifiable--it is your marginal tax rate multiplied by the additive inverse of the loss (assuming you have/will have other gains to offset). Let's just assume that you incurred a $1000 loss, at a marginal tax rate of 20%, which means your tax benefit for the loss is $200.
The second choice--to hold the stock in hopes of it rising in price (Option B)--is a bit harder to quantify. You must assume that today is day zero, and that every cent in price the stock rises is a gain to you, and every cent in price the stock looses is a loss to you. If you believe that the stock will rise to a price that will net your more than your tax benefit from option A, then holding the stock is more favorable than selling it at a loss today. Conversely, if you believe this stock will fall even further in the future, or not rise enough to net you $200 (per the example), then Option A is preferable.
Granted, there are some additional complications that play into your decision. By selling the stock today, you not only get a tax benefit from the loss, but you've also freed up the funds previously used to purchase that stock to be invested elsewhere (in hopefully a better performing asset). If you choose to stick with your current stock, then the gains you may have netted elsewhere must be considered as an opportunity cost associated with Option B. Finally, the tax benefit is essentially guaranteed (so in our example, a $200 risk free return), while sticking with the stock in Option B still comes with some risk.