Green gooey stuff when removing head from raw shrimp
I think what you are seeing may be the hepatopancreas. From a Serious Eats article about shrimp heads:

There could be nothing sweeter and tastier than those shrimp heads. For in their armored shells you will find the hepatopancreas, the digestive organ that in lobsters and crabs would be called tomalley.
Shrimp hepatopancreas tastes like tomalley, only shrimpier, and more liquid-like.


This article on hepatopancreas condition states that the color of the hepatopancreas depends on diet:

Regarding shrimp roe (also called coral) and eggs, please see this excerpt about the shrimp life cycle and the picture below.

Eggs develop in the female prior to spawning, and can be seen as a dark band just under the shell on the head. Shortly after mating, eggs are extruded to the underside of the abdomen, where they are fertilized by a packet of sperm previously obtained from the male, then attached to the female's specialized legs. The female carries the developing eggs until they hatch in early spring. Newly hatched shrimp larvae are small (about 3/16 of an inch, or 5mm), planktonic (free floating, unable to swim against currents), and bear only a superficial resemblance to adults.


See this picture (EMS is Early Mortality Syndrome):