I don't know if this is what Rav Shach means. But after reading him in the morning I went out and did some errands. On the way back it occurs to me that this is possibly what he means. But I am not sure. So for now I wish to write this the way I see it

The issue comes up in the end of chapter 9 in Bava Metzia. R. Yehuda holds we are not (going by the reason for a law) דורשים טעמא דקרא. R. Shimon ben Yochai hold we go bu the reason for the law דורשים טעמא דקרא. The general rule of how to decide halacha when there is an argument between tenaim is given in Eruvin. When there is an argument between R Yehuda and R Shimon the halacha is like R Yehuda.
In a verse in the Torah it says not to marry any of the seven nations. Or more exactly do not give your children in marriage to them so they will not turn the heart of your children towards idolatry.
R. Yehuda who does not look at the reason for a verse says we go by the literal meaning. It forbids only the seven nations. R Shimon says it forbids all nations that do idolatry because we go by at the reason for the verse, not by its literal meaning. So why does the Rambam decide marriage with all nations that do idolatry is forbidden? Tons of ink and megabytes have been spilled on this problem.
If i understand Rav Shach proper;y he has an amazing answer for this question but he does not seem to spell it out in the same way as I wish to put it.

The key factor to notice is the case of a king. The verse says he should not have many wives. The first opinion, the sages, says that means not to have more than 18 wives. R. Yehuda says he can have as many as he  wants as long as they do not tilt his heart.R Shimon says even one that tilts his heart he must not marry. So when it says not to ave many it means even like Abigail.
Rav Shach points out that here the first opinion and R Shimon agree. That is the key. But what Rav means I am not sure of. So I wish to write the way I see this. The  sages obviously agree with R, Yehuda that we do not go by the reason for the law.  But here we see R, Yehuda does go by the reason for the law because the reason is written explicitly. So what does R Shimon do when the reason is given openly? He  learns from both the regular verse and he learns something extra from the reason. So even though in general the sages go with R yehuda but in  a case when the reason for the law is given openly then they go like R Shimon.  This now gives us enough information to explain the Rambam. That is this. When the reason for the law is given openly in the verse the sages agree with R Shimon. And that is exactly the case with intermarriage. So in that case the sages will agree with R Shimon that all nations that serves idols are forbidden, not just the seven nations. And that is ho the Rambam decides. He decides this not because it is the opinion of R Shim but because it is the reason of the sages.