I have an idea how to make a dredging boat work in a relatively simple way:
The dredging boat behaves exactly like a cargo boat until it is going over a ressource patch (which is like the land based ore patches, but under the water). This script only needs to run when the ship enters a new track tile. The track tiles could also be marked, when placed on ores. Special stops could also mark the start and stop of dredging areas, but that would be another new entity.
Then it slows down, increases power consumption (and pollution) considerably and maybe plays an animation of it deploying something. It also creates a big invisible mining drill with it's output on the ship, so it directly inserts into the ship's inventory. The mining drill teleports to the ship everytime it moves to the next track tile.
The ship stops dreging, once the cargo hold is full or if it has left a ressource patch.
This could work on trains as well, which would make for an interesting standalone mod. Maybe with a dredging wagon, with little inventory and hidden inserters, that move the mined ore to the back cargo cars.
Maybe a module in the dredging ship/train could fill empty containers in the inventory or stack them at the cost of additional fuel consumption. Using battery equipment power would not be a nice mechanic, because then it could mix stacked and non stacked items with unsufficient power. If it runs out of fuel it just stops and this cost is also more immediate.
I also posted this suggestion to the Freight Forwarding mod.