The transfer function has a single pole at z = a. To ensure stability, all poles must be located inside the unit circle in the z-plane. Therefore, to ensure stability, you need to ensure only that the magnitude of a is strictly less than 1:
stable = (abs(a) < 1);
if stable
fprintf('The system is stable.\n');
else
fprintf('WARNING: The system is NOT stable.\n');
end
HTH.
Rick