Hello
There is no need to worry about it, or even biopsy at this stage. Getting a professional opinion along with a radiograph is imp right now regarding your pain n swelling
According to the image uv shown here, looks like a small scale infection and pigmentation is a reaction to it.
There are many factors causing pigmentation and the one causing ur pigmentation looks quite clear from the image, it can be due to a pocket or food lodgement.
To attend that properly you need to visit a gum specialist (periodontist) asap because it is not a self healing lesion and may soon start bleeding while chewing or brushing or pocket depth may increase
Next Steps
visit a Periodontist and get a dental radiograph and further minor procedure of curettage and
need to start with a gumpaint
Health Tips
keep that area as clean as possible by rinsing properly and vertical brushing
don't scrub with toothbrush horizontally