A few day before would be fine but be prepared for the security line
I strongly recommend checking the weather beforehand too, sunny days and clear nights are best.
I booked mine 30 minutes before visiting
4 days before. I agree that the high price would be better spend on a day with good weather as a big part of the attraction is outdoors and it is already windier and colder since its the 91st floor.
Thanks! Your answer is awaiting moderation.