To avoid the ‘connection causes loop’ issue you need to connect the input to the ‘deffered getter’ for the variable instead of the variable itself and set the variable itself from the ‘is almost finished’ trigger instead of the ‘on finished’.
Basically due to the way metasounds work you cannot connect a variable to a node that’s upstream from it because the entire metasound is basically calculated ‘in one go’, so essentially nodes can’t feed into themselves, the ‘deffered getter’ option for a variable says ‘give me the value of this variable as it was at the end of the last audio frame’, incidentally, the ‘is almost finished’ trigger will file one audio frame before the wav is done playing, so combining the two you can get the behavior you’re looking for.
Using the ‘is almost finished’ trigger and the deferred/delayed getter is essential in order to loop sounds correctly in metasounds.