There are various syntax errors in your code. Particularly missing double-quotes and inappropriate use of /branch (you want /ontrialend, not /branch):
<values>
/ myvolume = -5000
</values>
<block myblock>
/ trials = [1=mytrial]
</block>
<trial mytrial>
/ stimulusframes = [1=mysound, mytext, up, down, stop]
/ inputdevice = mouse
/ validresponse = (up, down, stop)
/ ontrialend = [if (trial.mytrial.response=="down" && values.myvolume > -10000) values.myvolume -= 500]
/ ontrialend = [if (trial.mytrial.response=="up" && values.myvolume < 0) values.myvolume += 500]
/ branch = [if (trial.mytrial.response != "stop") trial.mytrial]
</trial>
<sound mysound>
/ items = ("mywav.wav")
/ volume = values.myvolume
</sound>
<text mytext>
/ items = ("Volume = <%sound.mysound.volume%>")
</text>
<text up>
/ items = ("+")
/ position = (50%, 45%)
</text>
<text down>
/ items = ("-")
/ position = (50%, 55%)
</text>
<text stop>
/ items = ("stop")
/ position = (50%, 75%)
</text>