Jonathan,I do not have a formula for you, but am pretty sure the optimal TP diameter also depends on the air volume and pressure you dump to drive the pellet. In other words, the number of pumps you prefer to use might alter which TP diameter is optimal.We like to think larger TP diameters reduce flow resistance, but they also add "lost volume" that instantly drops the pressure of the air driving the pellet. The longer the TP, the worse the loss in efficiency from increased diameter. Ideally, the TP would be barrel bore diameter, but only if the TP was very short. Otherwise 3 to 4 mm diameters are typical. For very low power airguns, the TP can be smaller than 3 mm. Not to act as a power limiter, but as an efficiency enhancer.If a formula can be determined for the TP, it would almost certainly consider the TP flow area, rather than diameter. And the volume, and how that affects the starting pressure when the dump valve opens.
The recommended size is 75 or 80 percent of the caliber so not to damage the pellets as they pass the hole. The forward edge of the barrel hole needs to be chamfered and smoothed to not shave lead..177 @ 80 percent would be a .142 diameter transfer port. You could drill the barrel and transfer port to that. Since the hole in your valve is.170 now, the transfer port side facing the valve should be angled or chamfered to.170 to transition to the smaller hole.