The following snippet doesn't play the audio file (but the same invocation as standard command works pretty well).
How can I play an audio file within a script?
@script jscript
function OnClick(clickData) {
clickData.func.command.RunCommand("Play \"/dopusdata\Sounds\warning.wav\" QUIET");
}