There are two syntax errors in your example:
1. You are missing the end square bracket of the (link-reveal:) macro's associated hook.
2. Your (set:) macro is missing the reference to the variable who's value you want to add 2 too.
You could use either the actual variable's name or the it keyword if the variable is the same one as you are assigning the result to.
The following is a corrected version of your example.
(link-reveal: "Weapon+2 - 40 gold pieces")[
(if: $gold > 29)[Here ye go! (set: $Weapon to it + 2)]\
(else:)[You don't have enough money for that]\
]
note: I also added some line-breaks and Escaped line break markup to make the code a little more readable.