It's fairly easy. If you open the GECK and load Fallout3.esm, then go to the game effects part of the object window, then to ingestible. If you click on NukaCola there, you see it has a 'Nuka-Cola Add Cap Effect'. This adds the cap when you drink it. Double click on it. The effect's ID is NukaColaAddCap. If you add this same effect to beer (Don't forget the GetIsID player condition you also see on the nuka cola effect, so you don't get caps when other people drink their beer) then you'll also get a bottle cap when you drink the beer.