unitname removeaction ID
ID = is the same as you used in
ID = Unit addaction ["blablabla","nameofscript.sqs"]
Something like that ...I'm learning the same command at this moment...
That is the way it is
supposed to work. In the command reference BIS says the addAction command does not return an action ID, so you have to go with what Ruprt said.
The first custom action you add to an object is action 0. If you remove action 0, that action will go away, no problem. However, if you then add the same action, it now becomes action 1, so removing action 0 does nothing, you have to increment it the action ID you are removing.
It gets rather confusing, so I usually find a silly way to get around it, like keeping the action permenantly on the menu, but that is bad style. If you can work out a functional algorithm to remove your actions correctly, that would be best.