Well, if you only have 123 braincells, I doubt if you can ever make foam
Let's have a try; add a (blue node) displacement to scalar to your terrain output, have it followed by a color adjust and plug into a surface shader mask input that sits in the line of nodes for your water, after the water shader. Now check out you water level and fill in values approximating that value for white and black in the color adjust, one slightly bigger than the other, and see what happens. You shoud see a white border emerging near the coast. Play with the values from there...
If you happen to acquire more braincells; after the color adjust you can add a divide (divide by some small number (constant scalar) for distance between surf) then a sinus (blue nodes), then a muliply scalar (blue node) after that. Have the color adjust multiplied by the sinus, and feed that into the mask input of said surface shader (which should of course be white or so). Now you should have some lines following the coast. You can vary, warp, combine, breakup etc from there...