Do you pet her when she does that behavior? If so, it is encouraging it, even if you don't mean to or step out of the way first. If you can, I would try to just completely ignore her when she does that or even leave the pen. Unless it is dangerous to ignore her? But any attention is a reward in an animal's mind so try to completely ignore her. With extinction, often the behavior gets worse at first but then it should stop eventually. And maybe you could try to pet her instead when she is doing something you do like. You can teach her, or reward her for, some sort of alternate, more polite behavior, just like you could a dog. And believe it or not, pigs are actually very intelligent animals just like dogs, maybe smarter, so she shouls be able to learn very quickly I would think. BUT. Given that she was sort of a pet before, I wouldn't completely stop giving her attention or petting. Just at first. Ignore her for a while or teach an alternate behavior while you ignore the bad one and then when she learns pet her or even use food. Or you could possibly find her a pet home?