The FOS - Client-side Condition dynamic action plug-in is the ideal solution for adding if/then/else conditions to determine whether the following actions within the dynamic action should be continued.
This plug-in gives you the ability to specify a client-side condition to control whether the execution of dynamic actions continues or stops. If the condition evaluates to TRUE, then the rest of actions are executed, if the condition evaluates to FALSE, the execution stops and an optional "ELSE" custom event can be triggered.
If you require more branching logic than what this action provides we suggest you look at the "FOS - Trigger Event(s)" action which has a similar but more extended behaviour than this plug-in.