I don't think there's any real danger of that happening. It's CBS, so most episodes will be your standard self contained procedurals. She will probably escape at some point in the future because as we have learned from television, when you have a vast criminal empire, escape is easy, but she'll only appear during an occasional special episode. She may get mentioned on other occasions but it won't be the dominant storyline.

She'll be able to run her evil empire from prison. It's been done before.
And then escape during Sweeps.

The ruse at the end was based on "The Dying Detective" where Holmes faked a rare illness to lure a murderer to his rooms and then gloat revealing that he did indeed murder his nephew with the illness, and sent Holmes a box with a spring loaded needle intended to kill him as well.

The novel begins in 1891, when Holmes first informs Watson of his belief that Professor James Moriarty is a "Napoleon of Crime". The novel presents this view as nothing more than the fevered imagining of Holmes' cocaine-sodden mind; it further states that Moriarty was the childhood mathematics tutor of Sherlock and his brother Mycroft.

__________________
"The capacity of human beings to disappoint me is never ending." -- Ereth