Welcome to the forum. Responding first to the title you chose before I read the question itself: Gonorrhea certainly can persist for several months, but probably rarely longer than a year. Four years is extremely unlikely.
Now having read the question: Not only is it probably impossible for gonorrhea to last 4 years. If you really had gonorrhea tests over the years, it really isn't possible that they missed it. However, standard pap smears don't pick up gonorrhea; a specific test has to be requested by the provider. Most likely gonorrhea testing was not done during most of those exams. But that's not the important point; it remains extremely unlikely you have had gonorrhea for 4 years or more.
So one of two things is going on: either you indeed have recently acquired gonorrhea, or the test result is wrong.
As to the first possibility, your trust in your husband's fidelity is a very important consideration. You're in a better position than I am to judge whether that judgment is accurate. However, I have to wonder why your doctor decided to do a gonorrhea test for this pap smear? As I said, it isn't usual except in younger (under age 25 or so and/or unmarried women. Did he see something one examination that made him suspicious? Did you say anything about your or your husband's sexual behavior? Is there any chance your husband said something to your doctor without telling you?
If you are correct about your husband's fidelity, then a false positive test is the only possibility. You can't catch gonorrhea by nonsexual means. The likelihood of a lab error depends in part on the kind of test that was done. Some of the older tests, now in less common use -- for example, a "DNA probe" test -- give false positive results fairly frequenly. The newer, better tests -- called nucleic acid amplification tests (NAATs) -- rarely are false positive. But even with such a test, it is a small possibility.
You are on the right track to be retested; I'm glad your doctor has agreed to that. When it is done, I suggest you talke with him about exactly what test was done. (It's possible he doesn't know and might need to check with the lab.) Regardless of the test done before, insist on one of the NAAT tests (there are several brands) this time. Also, talk to your doctor about doing a culture test in addition to NAAT. Culture isn't done as often as it once was, but can be useful in sorting out uncertain situations.
In the meantime, it also would be a good idea for your husband to be tested. Of course if his result is positive, that will begin to solve the mystery. Also, once your repeat test has been collected and a urine specimen has been collected from your husband, it would be a good idea for both of you to be treated. It only takes a single dose of antibiotic, so it's easy -- and better safe than sorry if there is any possibility the result is accruate. Of course you and your husband definitely need treatment if either your husband's or your repeat test is positive.
Consider printing this reply and discuss it with your doctor. In any case, please come back to the forum and let me know exactly what test was done first time and the results of additional testing and your husband's test result.
Bottom line: I'm betting on a false positive test, i.e. that you don't have gonorrhea, and that both your repeat test and your husban'ds test will be negative.
I hope this helps. Best wishes-- HHH, MD
I should have thought to ask: What is your race/ethnicity? Are you in the US? Of course it is behavior, not race, that puts people at risk for STDs. However, gonorrhea is so much more common in African Americans (20-30 times higher rates than in whites or persons of Asian ancestry) that it would influence the probabilities.