Hmm. It looks right to me... not sure why it won't work. Try putting:
after the ActionEquipItem line, to see if that part is running properly.
And yeah, clearing the inventory was really just a safety precaution. You probably don't need it.