The maritime industry is undergoing a paradigm shift driven by rapid advancements in wireless communication and an increase in maritime traffic data. However, the existing automatic identification system (AIS) struggles to accommodate the increasing maritime traffic data, leading to the introduction of the very-high-frequency (VHF) data exchange system (VDES). While the VDES increases bandwidth and data rates, ensuring the stable transmission of maritime IoT (MIoT) application data in congested coastal areas remains a challenge due to frequent collisions of AIS messages. This paper presents a slot occupancy-based collision avoidance algorithm (SOCA) for a VDES network in the MIoT. SOCA is designed to mitigate the impact of interference caused by transmissions of AIS messages on transmissions of VDE-Terrestrial (VDE-TER) data in coastal areas. To this end, SOCA provides four steps: (1) construction of the neighbor information table (NIT) and VDES frame maps, (2) construction of the candidate slot list, (3) TDMA channel selection, and (4) slot selection for collision avoidance. SOCA operates by constructing the NIT based on AIS messages to estimate the transmission intervals of AIS messages and updating VDES frame maps upon receiving VDES messages to monitor slot usage dynamically. After that, it generates a candidate slot list for VDE-TER channels, classifying the slots into interference and non-interference categories. SOCA then selects a TDMA channel that minimizes AIS interference and allocates slots with low expected occupancy probabilities to avoid collisions. To evaluate the performance of SOCA, we conducted experimental simulations under static and dynamic ship scenarios. In the static ship scenario, SOCA outperforms the existing VDES, achieving improvements of 13.58% in aggregate throughput, 11.50% in average latency, 33.60% in collision ratio, and 22.64% in packet delivery ratio. Similarly, in the dynamic ship scenario, SOCA demonstrates improvements of 7.30%, 11.99%, 39.27%, and 11.82% in the same metrics, respectively.