I think your response--to give yourself a moment and then to correct--was just right. It's important to separate the action from what your daughter was feeling (anger and frustration at her father), which you did. And she showed a very mature response for her age--she was able to stop expressing her anger in a physical way and was moved by what she had done.
I think you handled it very well. You were able to contain your emotions and give her feedback (why her actions were dangerous and what their effects were) while not blowing it out of proportion.
I have experienced this, and it is the containing of our emotions that really allows us to make a better impression on our children. Older kids definitely can feel less important to their parents once the baby arrives, and their actions in acting out are often directed at the parents, who are not giving them entirely what they need. (whether or not we adults feel this is the case, it's the child's feelings we are concerning ourselves with here) Studies of the developing brain have shown us that children need to have their degree of stress and emotion reflected back to them. Ideally, when they are clingy and needing us, there is a biological 'survival' function being triggered in their lower, less-socially developed brain. (Think of it this way--without her understanding it, she's responding to having her resources limited in some way.) Thus, when we don't meet them or pull away, they experience this loss as Very Real Pain in their brains, and thus the tantrums begin.
If you want more information on this, check out The Science of Parenting. It's an easy read and extremely eye-opening. Much of our children's actions are deeply influenced by their juvenile brain development (or lack of it...). Your response was perfectly supportive in helping your daughter. It might also be that when she gets very clingy, to the point that you or your husband want to run out of the room, you could try some distraction techniques to help her come down from that space of neediness. Hug on her a lot physically, give her lap time as much as possible, and then get her started on some independent work if you can. Set her up at a table of playdough or another solo activity before leaving the room and give her a chance to refocus before taking parental attention away. In other words, finesse the transition however you can.
Regression happens, for all sorts of good reasons. Keep up the good work--your response was so great. By not overreacting, and by keeping the direction grounded in "this can hurt others" instead of "You Almost Hurt The BABY!", your daughter can keep moving forward into a positive relationship with her brother.