I don't think ioseftavi stating those two things together is inconsistent in the least. The stock markets go up and down, but the long term trend is certainly up. Your investing time horizon is a crucial component.
If you want to invest money, let's say for college, and will need it next year, I would strongly advise you to keep your money out of the stock market and put it somewhere safe like a 1-year CD or money market account--yes, even when interest rates are near zero, and even if I personally thought the stock market would go up from here over the next year. Conversely, if you were socking that money away for college but it was for your newborn so you 18-20 years before you'd need the money, I'd recommend the stock market as a great place to invest, even if I thought we were ripe for a 10% correction in the next year or two.
Over short periods of time, the volatility risk of the stock market can be large, and if you are counting on that money in the short term, it's not worth the risk. However if you look out over a decade or two, that volatility historically goes way down--almost always, the stock market will go up significantly over the long term. Then inflation comes into play as well-over the short term it's usually no big deal, but over the long term even a 2-3% annual inflation rate adds up fast, so a money market or CD account ends up losing a lot of value vs. those average stock market returns that will generally outpace inflation.
Then add in the effect of commissions and taxes if you are going to jump in and out of the market every time you change your mind about the direction it's heading, another huge penalty that adds up fast over the long term. Then of course, add in the amount of time you'll be wrong in your predictions on timing--which is often the biggest killer. It's one thing to say you think we're overvalued today. But anyone who has watched those figures over time will tell you that reality does not march in lockstep with those indicators--it will often go up for long periods of time while the indicators say it should drop, and vice versa.
The buy and hold method for long term investing horizons removes a lot of that risk, and keeps you in the game for the big gains you would miss if you were sitting out until just the right time to jump in. That's certainly true for the average investor, and even the experts have a pretty bad track record of calling every top and bottom.
For the record, I personally don't think stocks are highly overvalued today. But I will qualify that by saying if we had a 10% correction tomorrow, it would not surprise me in the least. I think that can happen at any time during a bull market, especially one that has gone on for as long as this one has. I don't think it's likely we'll have a 20% drop in the near future though (the general definition of a bear market). But again, that's just one man's opinion.