Thank you all for your responses. I will carefully study the suggestions  provided. sam is new to me and I am trying hard to learn it.  There are obvious errors in the script I provided and I apologise for those. I could as Rob suggested simply apply the ed script, but I am trying to learn sam's way of doing things. 

As for

% ssam -f thatscriptofyours somefile

It gave me this error:

bash: fg: %: no such job

Here is the ed script :
g/\*/s///g
# g/[0-9]/s///g
g/  *$/s///
g/   */s// /g
g/\(‘‘\|’’\)/s//"/g
g/\(“\|”\)/s//"/g
g/\(‘\|’\)/s//'/g
g/\\p/s//\
\
\
/gp
g/\\b/s//\
\
\
/gp
g/^  */s///
v/./.,/./-1j
# Replace two or more blank lines with a single blank line in Ed
wq