I think you did the perfect thing. She needs to know this behavior is unacceptable. The good news is she doesn't do it often. And if anyone slams you for giving her a time out, then they have a problem. Cats do need to have limits set for them, just like kids - even though we know the minute our back is turned they are going to overstep their boundaries. They do learn acceptable and unacceptable behavior, and giving her a time out was the right way to do it.