It sounds like you did fine... the strength these types of sudden squalls are difficult to gauge before they hit you, and can often come up very quickly, as you noticed. Whether you'd ever have the time to pre-prepare for one is debatable.
1984 Fast/Nicholson 345 "FastForward"
".. there is much you could do at sea with common sense.. and very little you could do without it.."
Capt G E Ericson (from "The Cruel Sea" by Nicholas Monsarrat)