I'm asking how to make a checkbox to easily enable and disable the AFC looping hack.

In order to enable AFC looping which fixes the Zelda Twilight Princess intro music, requires you to edit the UCode_Zelda_Voice.cpp and change:

if (true || PB.RepeatMode == 0)

to:

if (PB.RepeatMode == 0)

I want to create a checkbox so users can easily enable and disable this from the DSP settings. I've already got everything done except for the code to actually make this work. I need to know how to hook this actual function to the checkbox so it can be enabled/disabled by checking/unchecking the check box.

Does the code change affect other games in a bad way? If it gives only good results, there is no need to make a checkbox I suggest or it'll just make users confused (more "Is it better to check ..." thread).

Yes it does, the hack tends to cause music in Twilight Princess to cease abruptly, causes sound oddities in Windwaker and Mario Galaxy. So therefore it would be nice to make it so users can optionally switch it on/off easily from the DSP settings.