Thank you for posting a question on this topic. I work at MathWorks so I thought I'd take a stab at answering (I also had issues with notifications, hence the late reply!).
My first suggestion would be to try re-creating your own block. Most blocks in Audio System Toolbox are written using MATLAB code, which you can easily inspect to get a bit of inspiration. For example, try
and navigate to the computeGain method (make sure you don't modify the shipping code though!).
To create your own Simulink block based on MATLAB code, you can use the MATLAB System Block or the MATLAB Function Block - Start from the latter if you are more comfortable writing functions than objects.
I hope this helps.