For anyone interested in the subject:
Sea hares actually do have an ink gland. Tests with bromophenol blue and periodic acid Schiff indicated that the ink and granulated vesicles contain proteins and carbohydrates or maybe glycoproteins. Unknown to many, this is actually a common feature of the sea hare.
Below is a photo of a sea hare inking after being disturbed.
"The commonly believed function of this ink is that, like the octopus, it provides a screen or decoy so that the Sea Hare can quickly escape when attacked. Howevere, anyone with even a fleeting knowledge of live Sea Hares will realise the a 'fast escape' is not in the repertoire of these slow crawling slugs. In fact we have no idea what the purpose of this purple ink is. I lean towards the idea that it is an excretory product associated with eating red algae, and there is evidence to support that (Chapman & Fox)."
.....
"There is a lot of evidence, however, to show that Sea Hares store noxious chemicals from their algal food, particularly from red algae, in their skins, and when these chemicals are secreted, they provide a powerful defence against predation. You will see from messages below that the skin secretions are very distasteful. One extreme example is found in a Western Australian species, Aplysia gigantea which has been implicated in the deaths of many dogs. A comprehensive review by Johnson & Willows (1999) has recently been published. "
Both of these quotes come from Johnson and Willows book Marine & Freshwater Behaviour & Physiology where the authors discuss sea hares defense mechanisms.