Most people wouldn’t try to work this into the device type handler. They would just let the water leak sensor report as normal and then use any of the official features to have that water sensor reporting turn on a virtual contact sensor. And then have that virtual contact sensor trigger the Echo routine.
It depends whether you are using the new app or the classic app, but if you are using the new app you can use the custom automation creator. If you are using the classic app you can use the custom option under smart home monitor.
The trick to this is that when you create the virtual contact sensor, you also give it the capability “switch.“ that will then allow it to be turned on and off like a switch but still appear to be a sensor which is opened or closed.
There’s a community FAQ on this process which includes the code for sensor of this type. The topic title is a clickable link.
But in general when you want to have one device mirror another one, virtual or not, you do that through an automation, not through a device type handler. You just have two separate devices as always, and you have the action on one be the “if” And then changing the status of the other device be the “that.”