We owned a 23' Aquarious sailboat for over 30 years. Parked it in the back of the yard when not at dock; even let is sit unused for 10 years. Only once did we ever get mice in it. They made a mess, but because of available rolls of paper towels, they mostly chewed on that and left the important things like sails alone. It took us an entire day to clean up, and another day to put it back together.
Presume you have a fiberglass boat as we did. That means limited points of entry for the mice. We looked all over that boat and came up with only two possible points of entry and exit [When we found this, there were no mice on the boat, so they got in, but also managed to get out, which eliminated the air gap on the roof mounted cabin hatch. They might get in there, but unless they could fly, they could not get out there]. One was the center board cable. There was a small opening at the top where the cable attached to the winch. The second was the cockpit hatch, if there was enough of an opening when it was closed and locked.
Our solution was heavy duty aluminum foil. We crumpled it up an forced it into the small opening at the top of centerboard cable entry, and we twisted strips of foil into "loose ropes" and laid it around the cockpit hatch, then closed the hatch which compressed the foil and made a better "mouse seal" than before. We never got mice into it again.
As backup, we also included three mousetraps with peanut butter bait, and always left several rolls of paper towels available since they seemed to like that as first choice to chew on.
We never left any kind of food products on the boat while in storage.
We now own an O'day 240 and will use the above methods on it also.