The error is caused by the "<</if>\" missing a second ">".
Another problem is that your <<for>> line isn't quite right. This line:
<<for _h 0; _h =$swift; _h++>>
should be like this instead:
<<for _h = 0; _h < $swift; _h++>>
That assumes that you want 2 dice rolls if $swift is set to 2.
Also, a <<switch>> macro would be better here than a bunch of "<<if>>....<<elseif>>" lines:
<<nobr>>
<<set $herodice to ["Miss", "X", "X", "+", "+", "X+", "++", "XX"]>>
<<set $swift = 2>>
<<set _success = 0>>
<<set _boost = 0>>
<<for _h = 0; _h < $swift; _h++>>
<<set _roll to $herodice.random()>>
You roll: _roll<br>
<<switch _roll>>
<<case "X">>
<<set _success += 1>>
<<case "XX">>
<<set _success += 2>>
<<case "+">>
<<set _boost += 1>>
<<case "++">>
<<set _boost += 2>>
<<case "X+">>
<<set _success += 1>>
<<set _boost += 1>>
<</switch>>
<</for>>
<</nobr>>
That also uses <<nobr>> so you don't need "\" everywhere (the "<br>" forces a linebreak), initializes _success and _boost to 0, and adds to their values instead of just setting them. Also, you don't need the <<print>> macro, since SugarCube handles displaying "naked variables" automatically (as long as they aren't too complex).
Hope that helps! :-)