Mountain waves are considered seriously. Depending on the severity, you may or may not be able to hold altitude. The autopilot will try to hold altitude in the most basic designs. On the more sophisticated FCC type systems (such as on the MD-11, 777, A-340s, etc), the system will try to hold altitude until you near a high or low speed buffet margin, then may leave the altitude to maintain speed with the margins. Actually, I don't know that the 777 has that model in it (yet, Boeing is going to be including flight envelope protection in the future), but the MD-11 and the Airbus's do.
The problem is that autopilot algorithms are really a built up version of the original altitude hold function, with tons of "patches" to make them work. There hasn't been much change to the basic logic, but back to the topic at hand.
The main issue is usually keeping it on speed. The autothrottles move too slowly to keep it out of the buffet margins in all but the real mild waves, so you have to either disengage them or override them to keep it on speed. This will generally prevent getting into the high or low speed protections where the system will use pitch to maintain the speed envelope (at least on the MD-11).
I have been fortunate in that I have never had a problem maintaining altitude in any wave action. Our charts (domestically) are marked with areas of known severe wave action, so we can avoid them if the winds are blowing across the Rockies or the Sierra (no other ranges in the lower 48 produce significant waves). When we know of them or encounter them we slow to our turbulence penatration speed (this is NOT Va) and fly the slower of the IAS or Mach range, and within the range we use, we fly to the upper portion of that when up high (gust factor at altitude is less due to lower q for the same velocity of gust, however, loss of control due to stall is a real issue. Overspeed is not likely to result in loss of control, but stall is fairly probable). So, what it works out to is the mid-range for the IAS range or the upper end of the Mach range, for practical purposes, as the IAS range is only applicable below about FL280, where the q is higher.
There have been cases of aircraft experiencing structural damage during wave action. An Emery DC-8 had an engine separate over the southern Rockies a few years ago, for example.
Incidentally, the U.S. airline that pays the most attention to forecasting and avoiding areas of known turbulence is NWA. For some reason the other carriers have never gotten on that bandwagon, although there is some talk of that happening in the future. I don't expect my carrier to do it, though, boxes don't care!