Luiz,
I remember we had another thread on this topic. Something that I found interesting in the article linked to by Tornado in this thread (
Farrier Capsize article ) is that instead of using any kind of water sensor, they were looking at using a pitch sensor such that if the boat exceeded 90 degrees, it would deploy the mast bag.
I would also imagine that the bag could be made to fit in a recess in the top of the mast somehow.