it would be awesome for someone to possibly integrate it
Why not have a go yourself ? Report any problems here and you will get plenty of help. The principle is simple. Read the input, read it again a short time later and if it is still in the same state then either it did not bounce or bouncing has finished so it is safe to use the value read.
Now improve the program. Start by declaring the variables with types suitable for the range of values that they will have. For instance, do pin number really have to be ints or could they be bytes ? Then consider making variables that will not change their value (pin numbers again) into consts.
Neither of these really matter in your current program but both are good programming practice and could pay dividends with larger, more complicated programs.