Why do you think the errors are related to software serial?
It's a guess, that is why I put the question here in the hope to get an answer and may be a solution!
Why are you mounting a Wireless shield on a wired device
I am not. It is a GSM shield.
How much memory do you have available?
I will look into that. But I cannot explain why not enough memory causes failure sometimes after a few lines of code and sometimes after one loop. You would expect when running out of memory failure occurs at the same point.
More over I am using a standard board and a standard shield (both Arduino), with an example (unaltered) from the library page. May I expect that these three things work together?
Why are you calling Serial.flush()? Do you have a clue what it does?
Yes, I do have a clue. As mentioned I used the example written by Tom Igoe from the Arduino website.