There is no readily available linkage between my presence at the pat down and my identity. I have never had to identify myself for scanning or for pat down.
It would take some effort to link me, either via facial recognition or surveillance tracking back or forwards to a sign-in location where my identity is known.
After opting out 100% of the time for years, I've had my bags inspected by TSA (the little note inside) only twice (out of probably 10 domestic trips and 40 international trips). Both times were international and both times were where I was carrying random wires, Arduino experiment kits, etc. (things that probably look suspicious on an Xray).
I doubt either had to do with opting out.
This is false. I apologize in advance for not being able to substantiate this beyond my own anecdote, but I was once flying cross country, at the part where they scan your ID before standing in line to have your genitals irradiated. A part of the agent's screen that isn't normally visible was facing me for whatever reason, and when my ID was scanned, "opt out requested" or similar appeared in green text.
I had previously also been 100% opt out. Presumably they were referring to times I had opted out in the past.
I won't speculate about how they link this data, it's not terribly hard, but FWIW, they know, and keep track.
I've never gotten a TSA ticket, despite also flying with lots of questionable-looking microcontrollers. I've even gone so far as to leave a note in the bag explaining what each piece was.
It's common to get a mark on your bags (marking you for further checks) as they pass through the belt, which can be put there depending on whether or not you seemed suspicious to the guards. No need to actively identify yourself for that.
It might have had very much to do with it though, as in, the person refused body scan, and the TSA agent, who now had a chance to focus on them more, found them suspicious.
(In that, if they just went on an complied with the full body scan, the agent might not have thought about them twice).