Midges have ruined many a Scottish holiday, but seldom on a boat — they don't go to sea, or if they do not for very far. So they are seldom a problem unless you anchor, or tie up to a pontoon, close in under trees on a still and humid evening, or in the early morning, or of course if you go ashore to the pub. And they don't really appear until June, hanging around sometimes until October. It is the females that bite us, not the chaps.
But what to do if you are attacked? Close up the boat completely and marvel at the thousands of black, dead bodies on your deck in the morning. If you are caught outside then the cognoscenti carry midge nets to put over their heads, and most people have some sort of midge repellent ('Skin so soft' body spray is apparently not formulated as it once was and is not so good now I am told — do I really believe what a salesman of another product told me?). Making smoke can work, so pipe smokers welcome for a change.