How to calculate the variance of a discrete signal?
What is E in the equations for variance?

\$E\$ means "the expected value of something", please refer to: http://en.wikipedia.org/wiki/Expected_value

And as you've said


  'the variance of the signal is the mean of its squares minus the
  square of its mean'


So


  var_pwr = (sum(ins_pwr)/length(x)) -
  (sum(x)^2);


should be 


  var_pwr = sum(ins_pwr)/length(x) - (sum(x) / length(x))^2;


And there is another method to get signal's variance, you can see Ref. 1 and Ref. 3.

Some references:


http://en.wikipedia.org/wiki/Variance
http://en.wikipedia.org/wiki/Expected_value
https://dsp.stackexchange.com/questions/10620/algorithm-to-compute-the-variance-of-the-signal