Would it be possible to somehow calculate for each pair of clones how many steps they made in each other's "company" and save the data in a 2D table, or something?
There's no built-in feature for that, if that's what you're asking, but sure, any time a clone moves it can get MY NEIGHBORS and increment the relevant cells in a spreadsheet.
Some of the redundancy that's worrying you seems inherent in the thing you're trying to compute. If I move and I'm near three friends, then yeah, that'll be recorded three times. Otherwise the whole thing just reduces to the total amount that I move while near anyone.
As for the specific case of two people recording the same move with each other, that shouldn't happen because only the mover, the sprite that just did a MOVE command, should record the motion in the table. If A and B are near each other and are moving at the same moment, then that's two separate motions, and they should both be recorded.
But in the project it's not different sprites that move; it's clones of a single sprite, all using the same MOVE command within the same "when I start as clone" script.
A clone is a sprite! And even if the clones share code, each of them runs that code with respect to itself. And each clone should record its own moves in its own column of the table.