There's a bit of an anomaly in arrays. If you
global dim enemy[5]
You get array elements 0 to 5 (6 elements)
So you don't need to use
For c = 0 to MaxEnemy - 1
like you might in other languages.
When you change MaxEnemy to 10, you also need to change the array length to 10. The array has no connection to the variable MaxEnemy once you have declared the array length. Here is your original code with an amendment (compatible with AppGameKit V1 or V2):
global MaxEnemy = 5
global dim enemy[MaxEnemy]
do
if timer()>= 10
MaxEnemy = 10
dim enemy[MaxEnemy]
dim enemyX#[MaxEnemy]
dim enemyY#[MaxEnemy]
endif
for c = 1 to MaxEnemy
if GetSpriteExists(enemy[c]) = 1
enemyY#[c] = GetSpriteY(enemy[c])
enemyX#[c] = GetSpriteX(enemy[c])
endif
next c
sync()
loop