Wow!! Many ramifications to your question.
The easiest: You determine Woodland Scenics' available inline packages by the percentage grade you are looking for. 2%, 3%, or 4%. You include the curved run up to a flat section, then the declines. Example- a 2% incline would raise the track 4 inches over a 16 FOOT run. But then another 16 foot decline. That would give 4" clearance below the track- the NMRA recommends 4.5" clearance for O scale. You can compromise that by using lower locomotives (I have to cut off the Trainphone antennas from my PRR engines.). You can also help if you run a gradual grade- maybe 50% at 2% followed by 50% at 3% (leaves a portion of the train climbing a smaller grade -but makes the run even longer.
BUT more serious considerations are:
Most people put in a rise in order to get more trackage in a given space. But every degree rise affects one or more of a combination of:
1. number of cars our engine can pull
2. weight of those cars- no diecast cars!!
3. the quality and cost of engines- you will kill a base LionChief engine's small DC motor pulling many more than 5-6 cars, and over ANY grade. So you have to buy more powerful and dual motor - and more expensive locomotives. (And these are generally longer, heavier (for more traction), and require more generous radius turns, all affecting the practical grade.)
4. Adding a curve to the rise and the sharper the turns add further drag on the train.
ALL model railroading is a mix of compromises.
Overall recommendation: find a professionally-designed track plan you like, (there are hundreds if not thousands) FOR the space you have, allowing for clearance around the table(s) in the room for maintenance and to reach derailments, and with no grades. My layout is entirely flat, and when I added scenery the viewer does not notice the absence.
These are the reasons for the popularity of the smaller scales- the real limiter that decides track plan, curves, grades and everything else IS the available space.