Sand will go from wet with no air in the voids between particles to bone dry. The wet cycle can develop anoxic conditions which will kill tree roots of most species. One can set up to stay wet, or dry out frequently to avoid anoxia.
You are correct, mangroves at least in nature tolerate these wet anoxic conditions. If you are inclined you can develop a collection of tree and or shrub species that tolerate anoxia at the roots. Species that tolerate flooded conditions might be good. I'd look into how well bald cypress (Taxodium) and button bush (Cephalanthus) might be worth testing for a constantly wet sand situation. I have encountered Cephalanthus well into permanently flooded zones of lakes and riverbanks. There are other riparian species worth checking out, though I am not as familiar.
The other way to go is to go with the desert. or drought tolerant species. I have a couple Bursera that I grow because I love the fragrance of the foliage, and sap, they are shrubs, but they do not ramify easily or well, and due to swelling, they tend to look pretty awkward as trees. Bursera, Commiphora, and Boswellia are 3 genera of pachycaul trees, all three genera require drying out between watering. During winter, I only water my Bursera maybe once every month. Only when I water my cacti. These 3 genera are grown for incense, all species of these genera have fragrant sap. The tissue of the trunk swells to hold water, this expanding and contracting creates a peeling bark. They are visually interesting even if they do not fit conventional bonsai standards.
Baobabs are unrelated but have similar adaptations, tolerate drought well. Only water your baobab when showing signs of active growth. If they drop their leaves, they are dormant. They MUST be kept bone dry while dormant or rot will set in. In general they only grow when temperatures are warm at night and higher in the day. I'm guessing about 70F at night. In Memphis, my friend's baobab only has leaves June, July and August. It goes leafless sometime in September. Exact temperature needed to stimulate growth may vary with species. I forget which species he has. Key is the minute leaves start to yellow, quit watering, let it get bone dry and keep it dry until new growth emerges the following year. Again, coarse branching, but not too bad as bonsai. A tricky subject for bonsai.
There are a number of sage brush and creosote bush type species that are desert plants that might be worth exploring for sand media bonsai. So I say give it a go. Go constantly wet, or more or less dry. The most difficult would be to grow the conventional, the maples and azaleas will be your most problematic, as they don't tolerate anoxia and won't tolerate drought.