I am modelling in HEC-RAS a channel which discharges into Baltic See.
At the end of channel there is a gate, which is normally opened.
If the tide elevation is higher than 0.6 m, the gate will be closed. However, if the water elevation of river is higher than tide, it will be opened again.
You could also use a lateral structure. The lateral structure has a flap gates option for culverts, which only allows one way flow. However, this is a simple binary operation in that it is open if the river is higher, closed if the sea is higher. There can be no other conditionals like “if the sea reaches 0.6 meters, close the gates”. In that case, I would certainly take Jarvis’ advice and use the gate rules scripting feature.