Get the tag "waterlogged" at the block location (in Set Variable), It should return 0 if the tag doesn't exist at the block and "true" or "false" based on if it is waterlogged. (The action should be located in the set variable world section, I don't really know I am typing this at school so I can't check but this should work.)