Hello - first the liver flukes and now this! I do not think it is ascaris roundworms - they incubate and hatch in the lungs where they are coughed up in phelm. The phelm is swallowed - then the larvae travel to the intestines where they grow into adults. But you don't have any wiggling sensations in the throat area - if you did, I would guess ascaris. This stuff is also dry - not wet.
This hard chunk could just be dried sinus drainage - the sinuses drain from the head into the back of the throat - maybe some of it is thick and is just sticking back there - until it is so hard that is nearly choking you to death when you are coughing it out.
I wish I could be of more help here - but maybe this will give you more to reasearch on.