Control System Optimization Techniques for Real-Time Applications in Fusion Plasmas: The RFX-mod Experience