Long wait times on multiple capacitive sensor leads

I've been having some trouble with a project involving multiple capacitive sensors myself, but for a single sensor I did write a program that worked quite reliably on my Arduino Uno test rig that did not use the capacitive sensor library and had a much faster response. In my case, the circuit consisted of a 10MOhm resistor across pins 6 and 4, with pin 6 also connected to my touch surface. The internal LED on pin 13 was used as my indicator. My guess is that the library runs effectively the same code, but runs it multiple times per sample to improve stability, but not counting what I presume to be a brown-out condition I encountered with a low quality USB cord, this exact build worked very reliably.

Now, the caveat is that my attempt at building a multi-sensor system has run into some issues. I tried to replicate more or less the design 6 times on a Nano Every, but while testing it seems sometimes the program gets caught in the while loop until I touch the sensor again, and I've encountered strange glitches when touching the LED leads, so I suspect there may be issues related to grounding and how I wired the thing.

long T1 = 0;
long T2 = 0;
long Tn = 0;
int const Threshold = 3000;

void setup() {
  pinMode (4, OUTPUT);
  pinMode (13, OUTPUT);
  pinMode (6, INPUT);
  Serial.begin(9600);

}

void loop() {
  digitalWrite(4, HIGH);
  delay(10);
  digitalWrite(4, LOW);
  T1 = micros();
  while(digitalRead(6)){
    }
 T2 = micros();
 Tn = T2-T1;
 Serial.print(Tn);
 Serial.println();
 digitalWrite(13, Tn >= Threshold);

}