@Darkhog
A few notes about your code:

You can set size of dynamical multidimensional array using SetLenght(array, XDimension, YDimension).
http://stackoverflow.com/questions/5...ensional-array

Also why not storing chink IDs in nuerical way. So you can have soething like this:
Air = 1, Water = 2 and all ground chunks have ID higher than 2.

So spike placment code would look something like this:
Code:
if ((Chunk[x][y]<3) and (Chunk[x][y-1]<3) and (Chunk[x][y+1]>2) and (Random(101)<TrapChance)) then Chunk[x][y]:=SPIKEID;
With this you get rid of yourself of that or statment. And becouse you would probably have multiple ground types in the future you saves yourself the need for checking each posib le ground id in the first place.

I would also split that multicondition if statment of your into several nested if statments. Why? When you are using multiconditional if statment all conditions get checked even if first condition isn't met already. So using nested if statments could speed up your code a bit since it won't be ckecking if other conditions are met, when the first condition has already failed to meet the requirements. Not to mention that such code would be more readable.