Ok, so I have reworked my discovery scanner script, and it seems to work.
It does tell me how many notable planets there are as per the criteria in my Bodies notable script, even if it's the first time I've been to that system.
If I'm understanding you correctly though, it is only doing this because those bodies have already been uploaded to EDSM?
If it was a completely undiscovered system then it would have no way of knowing what the planet types are in that system until they had been full system scanned, and would therefore not report as notable bodies from just honking, is that correct?
I do have a section that reports any undiscovered bodies so I guess if that is the case then it would still work in that it tells me when FSS is worthwhile.