I have no idea!! :O, could it be possible a rare specimen like those kind of large worms… it seems to me that it was dying, or like if it was not its place of living or could be just its spasmodic movements.
I went to look for large worms: Dioctophyme renale, a parasite (up to 10m) _http://en.wikipedia.org/wiki/Dioctophyme_renale up to 10 m, D. Latum another parasite like worm _http://en.wikipedia.org/wiki/Fish_tapeworm. The Microchaetus rappi but is pink ¬_ http://en.wikipedia.org/wiki/Microchaetus_rappi, up to 6.7 meters!!, The Lineus longissimus up to 30 meters!!! _ http://en.wikipedia.org/wiki/Bootlace_worm.
added: info