The masturbation-machine and the baboons were both in the 1971 novelization of THX, FWIW.
Were they in George’s script though? Ben Bova could have embellished George’s ideas with his own much as Alan Dean Foster did ghostwriting the SW novelization.