Once $q(x)$ is normalized, then the mean of $X$ is 0. Therefore, the variance is the expectation of $X^2$. To estimate the variance using self-normalizing importance sampling one can perform the following steps:
(* Define the function proportional to the pdf of the nominal distribution *)
q[x_] := Exp[-Abs[x]^3/3]
(* pdf of proposal distribution (also called the importance distribution *)
p[x_] := PDF[NormalDistribution[], x]
(* Get a random sample from the proposal distribution *)
SeedRandom[12345];
y = RandomVariate[NormalDistribution[], 1000];
(* Calculate the weights *)
w = q[#]/p[#] & /@ y;
(* Calculate the estimate of the variance *)
variance = (y^2).w/Total[w]
(* 0.767868 *)
If the proportionality constant for the pdf of the nominal distribution was known, then the following steps would obtain an estimate of the variance using importance sampling:
(* Define the function proportional to the pdf of the nominal distribution *)
q[x_] := (3^(2/3)/(2 Gamma[1/3])) Exp[-Abs[x]^3/3]
(* pdf of proposal distribution (also called the importance distribution *)
p[x_] := PDF[NormalDistribution[], x]
(* Get a random sample from the proposal distribution *)
SeedRandom[12345];
y = RandomVariate[NormalDistribution[], 1000];
(* Calculate the weights *)
w = q[#]/p[#] & /@ y;
(* Calculate the estimate of the variance *)
variance = Mean[w y^2]
(* 0.768766 *)
The "true" variance is given by
Integrate[x^2 (3^(2/3)/(2 Gamma[1/3])) Exp[-Abs[x]^3/3], {x, -∞, ∞}]
(* 3^(2/3)/Gamma[1/3] *)
(* Approximately 0.776458 *)