The rap/handshake that Josh (Tom Hanks) and Billy do multiple times in the film was suggested by Tom Hanks. He felt that the boys needed some sort of secret handshake and Hanks' son had just learned it at camp. The director loved it and put it in the film.
Tom Hanks still has it memorized. Check out this interview from 2009 where he does it perfectly, hand motions and all.