You don't get to claim self-defense when your own illegal actions led to the situation. Nor when there isn't an immediate threat to injure you and threatening to expose your illegal actions just isn't going to cut it.
I didn't mean to imply that it could be considered self-defense according to the letter of the law. Just floating the scenario where you're running a business that, while illegal, is not morally wrong, and you're faced with the possibility of spending the rest of your life behind bars. What do you do?
They would tell you not to run that business because it's illegal. There are legitimate ways to protest a bad law and running an illegal business isn't one of them.
You run a business in the 1800s that frees blacks from the South and transports them to the North. If caught, you risk some severe penalties, maybe even death.
Someone finds out and blackmails you. What do you do?
I think it might be better understood if I said 'legal' instead of 'legitimate'. The law, by its nature, cannot excuse breaking the law.
EDIT: Also, in your example, this was eventually fixed by changing the law, not by breaking it. And, to the best of my knowledge, everyone ran the underground railroad for free, not for profit.
You can find further details here: http://lawcomic.net/guide/?p=864
It's written by an actual lawyer, in spite of being in comic format.