You don't avoid recursion, all you do is slow it down to the framerate.

If you want to avoid recursion, you should be checking if (action.GetID() != ACTION_TRIGGER_OSD) before calling OnAction on it.