It is entirely possible to figure out if something is over- or undervalued. Not only individual stocks, but also asset classes. The problem is, the markets can stay irrational longer than you can stay liquid (crash) or you can mentally stand staying aside and watching prices go up even further (boom/bubble).
By choosing an asset allocation that fits your risk profile, and maintaining that asset allocation, it doesn't really matter if stocks are expensive or not... When stocks are expensive and bonds are cheap, you buy more bonds, when stocks are cheap and bond sexpensive, you buy more stocks. You will not make that one killer trade, but over time, it will work in your advantage.
There is only one exception: when there is blood on the streets, buy. Even if it's your own blood. These obvious occasions are rare, and it takes a very strong will. 2008 was one of these wonderful occasions. Everybody was scared, I was thrilled. But even then, timing perfectly is nearly impossible. For example, I always tend to buy to early, literally catching that falling knive. Works way better than running away scared and coming back to late, but you have to be brave enough to look at red figures in your depot sheet for a year and remind yourself "it will end well, and at least they're paying me dividends..."
If you cannot stand that, get shaky hands and sell half a year later, your in for a disaster. Even with these great events, you CANNOT time the markets perfectly, only roughly. And that needs time to smooth out.
So unless there is blood in the streets (and you are brave enough and have a long time horizon), choosing an asset allocation and then sticking to it is the closest you can get to buying efficiently.