The direct ink writing (DIW) process, used for creating components with functionally graded materials, holds significant promise for advancement in various advanced fields. However, challenges persist in achieving complex gradient variations in small-sized parts. In this study, we have developed a customized pin shape for an active screw mixer using a combination of quadratic B-Spline, the response surface method, and global optimization. This tailored pin design was implemented in a two-material extrusion-based printing system. The primary objective is to facilitate the transformation of material components with shorter transition distances, overcoming size constraints and enhancing both printing flexibility and resolution. Moreover, we characterized the transition delay time for material component changes and the mixing uniformity of the extruded material by constructing a finite element simulation model based on computational fluid dynamics. Additionally, we employed a particle tracking method to obtain the Lyapunov exponent and Poincaré map of the mixing process. We employed these metrics to represent and compare the degree of chaotic mixing and dispersive mixing ability with two other structurally similar mixers. It was found that the optimized pin-type mixer can reduce the transition delay distance by approximately 30% compared to similar structures. Finally, comparative experiments were carried out to verify the printing performance of the optimized pin-type active mixer and the accuracy of the finite element model.