Actually, TriciaF, it is not the OPs child, it is her son and DILs child. Yes, she is the grandmother, but that is not the same as being the parent of the child. Legally, she has absolutely no right to slap her DGS, as he is not her child. So it is someone else's child that she has slapped. In fact, a simple google of this will tell you that in California (where the OP states she was) and in the UK, only parents have the right to use corporal punishment.
I think the thread has gotten a little too caught up in the debate over slapping, which is a separate issue and a parental choice. The OP asked for advice on how to handle the situation of having slapped her grandson, she is clearly aware this was not her place to do as she is not a parent and he is not her child.
For what its worth OP, I do think it would have been best to come clean at the time. If it was me, I would still do so, stressing to DS and DIL that I did not intend to do so, that I know my actions were inappropriate and to apologise. It would be best to do this, rather than risk DGS mentioning it to his parents and them confronting you, which could go a lot worse.
And to those telling the OP to not admit it as DGS will most likely have forgotten/moved on from it, I think most people here would know that children have a way of letting things slip even when we think they've forgotten!