It's a sci-fi movie from the late 60s to early 80s, in color, and the vague bits I remember are:
It was probably set in outer space. A man kept waking up in strange places and began to question his reality. On one of these occasions he woke up covered in some kind of webbing (or net) and seemed distraught as he removed it. Then as he proceeded to explore his surroundings someone or something crossed the corridor behind where he couldn't see.
On another occasion he was being given electroshock treatment of some kind. I remember someone putting something in his mouth to prevent him biting off his tongue, then someone turned a knob and an oscilloscope went crazy and the man convulsed violently.
Those are the only things I remember from the movie. I'm almost 38 and I saw this when I was in the single digits age wise.