I'm on another forum that deals with terrariums, and people there have had mixed experiences with Great Stuff. Apparently it is very hard to get stuff to stick to it, because it just pushes it out as it expands. You could try spraying the foam on, letting it expand somewhat, and then shoving your rocks for your waterfall in there really good and holding them there a bit as the foam continues to expand. Then when it's all dry, you could smear all the cracks with black silicone to make sure the rocks stay in there.
When you put your cocomatting on the rest of the back of your tank, make sure you use LOTS of silicone. Gob it on really good, and lay your tank down so that the back is on the floor, and weight the coco panels with heavy books or something while it all dries. Because yes, water does rapidly deteriorate cocomatting, which is why treefern panels are recommended if you don't want to redo things every few years. They are much more expensive to begin with, though not in the long term (figure in replacing the cocomatting every 2-3 years, whereas treefern lasts at least 10 years).
Another thing that is especially popular with the dutch is to use the foam to give things shape, and then coat it (when it's dry) with a mix of Weldbond glue (yes, it's non-toxic) and peat moss. This is the ground-up peat moss we're talking about, not the long-fibred stuff for growing orchids. It needs several days to fully cure, but apparently it's great. The peat moss holds moisture for the plants that grow all over it, and the weldbond holds it all together. If you are impatient and don't wait at least a week for the weldbond to cure, it will be certain disaster, as the whole thing just collapses in a soggy mess when it gets wet.
Hope this helped!