Hallo Frank94062
Whether the trains are expected to be full or not has absolutely no influence on the ‘best’ time for buying your ticket. Because railway tickets here are always available in unlimited numbers at the same price (until end of year), so they never sell out, similar to subway or museum tickets in your country. So absolutely no need to ‘secure’ them in advance.
The time required for leaving the ZRH airport depends on whether Dock E is involved and how many flights are arriving at the same time. Roughly anything between ½ and maybe 1 hour between gate and railway station is possible. But that doesn’t actually matter, as your train ticket will be valid all day on any service to Lucerne (assuming a regular point-to-point ticket). There are 3 connections every hour, but you might prefer the IR13 and IR75 services which do not require to change trains with your luggage after a couple of minutes already at Zurich main station.
Around noon is outside of the peak commute times, therefore expect about half full trains. But you can’t reserve seats on those IR trains anyway. On the platform, simply avoid the area next to the escalators where most other pax will be waiting - rather wait in a less busy section, minding where coaches with the correct class are expected to halt according to the displays above the platform.
Back to the best time for the ticket purchase: In times of fuel shortage and uncertain schedules, I would recommend getting the ticket only once you’ve really made it. Either while waiting for the Skymetro or your luggage, or at the SBB ticket counter.
If buying in advance nevertheless, simply AVOID supersaver tickets, as those are NOT refundable in case of a flight delay or cancellation - get only the regular point-to-point offer, which could get cancelled/refunded until midnight CET before arrival.