for/in a long time

1a. I have been sitting here waiting for a long time.
1b. I have been sitting here waiting in a long time.
1c. I haven’t been sitting here waiting for a long time.
1d. I haven’t been sitting here waiting in a long time.

2a. I went to the gym, something I have done for a long time.
2b. I went to the gym, something I have done in a long time.
2c. I went to the gym, something I haven’t done for a long time.
2d. I went to the gym, something I haven’t done in a long time.

3a. I won’t be going to the gym again for a long time.
3b. I won’t be going to the gym again in a long time.

Please correct all and comment. Thanks.

1b is not possible.
On the face of it, without additional context, it looks as if 1a and 1c are the positive and negative versions of the sentence.
However, in a different context 1c can have a different meaning and can indicate that you are at a place or looking at a place where you have waited before (perhaps you waited there regularly in the past), but it has been a long time since you did so.
1d has a similar meaning to 1c in this second context and indicates that you are sitting there waiting now, and you have done so before, but it has been a long time in between the two occasions.
To avoid the confusion between the two contexts in 1c, it is possible to use ‘long’ instead of ‘a long time’ for 1c, and that is the most common form:
I have been sitting here waiting for a long time. / I haven’t been sitting here waiting for long.

In the same way, 2b is incorrect, 2a and 2c are positive/negative versions and in this sentence, 2d has the same overall meaning as 2c

3b is incorrect because you are talking about a future event.

Beeesneees,
1a. Long time ago, I worked at TVS.
1b. A long time ago, I worked at TVS.
1c. Long ago, I worked at TVS.
2a. I hadn’t traveled a long time.
2b. I hadn’t traveled for a long time.
2c. I hadn’t traveled in a long time.
Please correct the above and comment. Thanks.

1a. Long time ago, I worked at TVS. - incorrect
1b. A long time ago, I worked at TVS.
1c. Long ago, I worked at TVS.
2a. I hadn’t traveled a long time. - incorrect
2b. I hadn’t traveled for a long time.
2c. I hadn’t traveled in a long time.

the b/c pairings carry the same meanings.