The important thing here is that we include 'ADD 1 TO S' so that every sprite that gets initialised is added to the Sprite Counter (S) - we use this throughout Shmupkit to ensure we keep track of how many Sprites are currently on Screen, since MPAGD has a maximum of 12 sprites on screen at any one time, HOWEVER, I don't recommend aiming for 12 as I find a general slowdown and the potential for things to go wrong, aim for 10 or 11 and you should be ok.
Remember though that Your Player, Player Missile & Enemy missile will count as three sprites, so in reality you can probably only get 8 alien sprites on screen at any one time.
ADD 1 TO S ; increment the sprite counter
IF TYPE 1 ; PLAYER TORPEDO
LET SETTINGB = 0 ; initialise the distance counter
IF TYPE 5 ; ENEMIES
LET SETTINGA = 0 ; Initialise SettingA
IF TYPE 7 ; SPAWNER
LET SETTINGA = 0 ; RESET SETTINGA