im sure the common cockroach is on a distant evolutionary path from that of shrimp. as i recall marine life came first then terrestrial life. there have probably been a shrimp of sorts in the ocean for millions of years before bugs ever existed. but by all means go eat your bugs. the flavor will be distinctly different.
Shrimps: Kingdom Animalia, Phylum Arthropoda, Subphylum Crustacea, Class Malacostraca
Cockroaches: Kingdom Animalia, Phylum Arthropoda, Class Insecta, Order Dictyoptera
I did a quick search to try looking up the evolutionary distance between a common shrimp genus and common cockroach genus but I didn't hit on any promising results. Suffice it to say that the two are not that closely related. You are pretty much correct.
As for marine over terrestrial life, that is only a quick rule of thumb and should generally only be applied to the lowest phyla of the animal kingdom. Sponges are your simplest and likely earliest form of animals and are found exclusively in marine environments; by contrast, whales are also marine animals but are a relatively recent form of animal life and there are several Families (level of classification) of terrestrial animals that are considerably older in evolutionary terms. =)