Perhaps there is local formatting that you need to override? Try this:
set character style of paragraph 1 of selection to null
set character style of paragraph 1 of selection to "H2"
Then there are questions such as: Have you actually selected the type? Applying to selection is not always a good idea, you might be better using :
tell story 1 of text box 1
set character style of paragraph 1 to null
set character style of paragraph 1 to "H2"
end tell
In general, saying something 'doesn't work' isn't very helpful - try and describe as clearly as you can exactly what happens. If nothing happens at all, try varying the script a little so you can fathom what isn't working. Try inserting little 'display dialogs' to let you know where the script has got to.