Does anyone know if there's any evidence of pupae being able to sense chemical cues from the environment, etc? Or to produce chemical signals? I'm mainly interested in Lepidoptera, but any other group could be interesting as well.
I think that a secondary part of your question (pupal production of chemical signals, received by conspecific individuals or individuals of other insect species) can find answers by exploring for instance two very wide fields of entomological research, i. e., a) communication among social insects inside their colonies and, b) relations parasitoid-host and predator-prey (as regards entomoparasitic and entomophagous insects looking for pupae).
I can add that, for some insects, intraspecific communication by pharate adults (adults still into the pupal cuticle) is known or hypothesized, having the function to synchronize (together with other factors) adult emergence of more individuals.
I am pretty sure there is a publication from Johannes Steidel for Nasonia vitripennis. He has done a lot of work on odor recognition and memory using odor cues in pupae.
Here are some links to some of his publications but I am not sure in which you wil find what you are looking for (I haven't read them all just listen to his talks all the time :-) ):
This is really interesting. I had the idea that pupae must been able to produce, or at least sense chemical signals. These articles have been very useful.