Image source: Getty Images As an investor, I like to buy shares and profit handsomely from holding them over the long term. However, investing in Lloyds (LSE: LLOY) over the past few years would have made that difficult. The bank’s share price is within 1% of where it stood a year ago even after a recent strong rally. It is 23% lower than its level five years ago. Looking back even further to the financial crisis, Lloyds shares today sell for barely a sixth of their 2007 high price. Even further back things look worse still! The Lloyds share price flirted with £5 in 1998. Lately it has been flirting with 50p, close to one-tenth of its value a quarter of a century ago. Has anything changed that might persuade me that buying into Lloyds today could be a good move for me as an investor? Growth or income One thing to consider is the dividend. While my numbers above focus on share price movement, dividends have been a source of income for Lloyds shareholders for some of the past quarter-century. Right now, for example, the yield on Lloyds shares is 4.1%. The interim dividend this year saw a beefy 12% rise compared to last year. However, Lloyds stopped its dividend during the pandemic (due to a regulatory requirement). It has still not returned to the size it was beforehand, despite mammoth profits last year that enabled a £2bn share buyback. It was a similar story during the financial crisis. After 2008, the dividend was suspended until 2015. No dividend is ever guaranteed. But Lloyds has proven fairly unreliable over the long term when it comes to dividend consistency, compared to companies like Spirax-Sarco or Diageo, which have raised their payout annually for decades through thick and thin. Attractive valuation One result of Lloyds shares declining over the long term is that their valuation has looked increasingly attractive. The price-to-earnings ratio is now just nine. It is common to value bank shares using the alternative measure of price-to-book value ratio. On that basis, too, I think Lloyds shares currently look attractively priced as a potential addition to my portfolio. Past performance is not a guide to what comes next. Just because the Lloyds share price has seen long-term decline does not necessarily mean that the same thing will happen in future. Lloyds continues to have the makings of an excellent business, as its profitability shows. It benefits from well-known brands, a large customer base, and resilient demand for financial services in the UK. British banks including Lloyds now have a more robust approach to risk management than they did before the financial crisis. Difficult environment But those valuation metrics are based on current earnings and book value. If the recession leads to loan defaults rising sharply, earnings and book value at the bank could fall significantly. The bank has said defaults remain at low levels. But post-tax profits for the first nine months of last year fell 24% compared to the prior year period. I fear things could get worse from here. That risk — of a bad economy pushing up defaults and hurting profits — is enough to put me off investing in the bank right now. I have no plans to nibble, even at the current Lloyds share price.