I believe ultimately you can implement this as a push down automaton (PDA). The high level design is that you want some actions to take priority over others, so lets delve deeper.
It's actually not that much deeper.
(IDLE) --[NO TARGET POSITION] --> (IDLE)
(IDLE) --[TARGET POSITION]--> (WALK)
(WALK) --[NO TARGET POSITION] --> (IDLE)
(IDLE) --[UNDER ATTACK] --> (FLEE)
(WALK) --[UNDER ATTACK] --> (FLEE)
(FLEE) --[NO TARGET POSITION, NOT UNDER ATTACK] --> (IDLE)
(FLEE) -- [TARGET POSITION, NOT UNDER ATTACK] --> (WALK)
Turns out you can use an FSM. It's possible your example is not truly representative of what you are trying to do. Interestingly enough every FSM can be represented with a directed graph which is also how you represent a behavior tree. So you could represent your behavior tree with a directed graph and equivalently a FSM.
You could in fact create behavior tree's which are not representable by an FSM, but they probably wont make sense. To do so in a manner that is not "repairable" you would need to create a behavior tree where a node has a path to two different nodes for the same condition. This seems to be an unlikely condition because it probably doesn't make sense. Consider a behavior tree where being attacked resulted in fleeing and idle.
Furthermore, if you want your character to return to their initial state AFTER a behavior, you can use a PDA. In this case you simply PUSH their current state, and then continue on your merry way to the next state. When it is completed it pops your previous state and returns to it.
IDLE -> WALK -> (UNDER ATTACK) -> PUSH STATE (WALK) -> FLEE -> (NOT UNDER ATTACK, TARGET POSITION) -> (POP) -> WALK