You could do it with three Grep queries:
Find what: (\d)\Z
Change to: $1~%
Find what: (\d\d)(?=(\d\d\d)+\b)
Change to: $1,
Find what: ~%\Z
Change to: <Leave blank>
But running three queries is a drag, so this script runs them:
app.findGrepPreferences = app.changeGrepPreferences = null;
function change (f, r) {
app.findGrepPreferences.findWhat = f;
app.changeGrepPreferences.changeTo = r;
app.documents[0].changeGrep();
}
change ('(\\d)\\Z', '$1~%');
change ('(\\d\\d)(?=(\\d\\d\\d)+\\b)', '$1,');
change ('~%\\Z', '');
The first query adds a sixth-space at the end of every cell. I forget now why that's necessary (it's been a while), but it is. Then the second query inserts the thousands separators (here, a comma; to change that to a dot, replace $1, in line 10 with a $1.). Finally, the third query removes those cell-final sixth-spaces.
This one doesn't add separators in 4-digit numbers. To do that, in line 10 change '(\\d\\d)(?=(\\d\\d\\d)+\\b)' to '(\\d)(?=(\\d\\d\\d)+\\b)',
P.