it is both exciting and terrifying that this is the API that has been exposed to players. anyway, if I am interpreting the code correctly, I think it will break (unless there is some embedded exception handling for accessing a card with an index greater than the deck size).
in general, try to avoid changing the loop iterator (n, in this case) outside the loop definition. e.g.,
Code:
void beforeStart()
{
Player p = getHumanPlayer(0);
for ( int n = p.deckSize()-1; n >= 0; n-- )
{
if ( p.getDeckCard(n).getName() == "Soul Plague" )
{
p.removeDeckCard(n);
}
}
}