Cruising altitude is something like 30,000 feet, isn't it? I think they made a judgement call about their missile's range and the best place to fire it without getting caught.
1. TWA Flight 800 departed JFK Airport more than an hour late, so anyone off the south shore of Long Island who targeted that specific aircraft wouldn't have been able to predict the time and place where it would fly overhead.
2. From what I've read, Flight 800 was actually flying lower than usual that night through the area, having maintained a lower altitude to make way for a northbound aircraft flying into Providence, Rhode Island. Nobody would have been able to predict that. If anything, this supports a scenario of an accidental downing by a naval vessel conducting exercises off the south shore of Long Island that night.
3. Shooting a missile at an aircraft flying 15,000 feet overhead from a point that far east makes no sense if you're doing it from there to avoid getting caught. At that altitude there's a serious risk that the missile won't hit its target -- which means you're running the risk of getting caught without any certainty that your plan will even work.