Well right off the bat, I'm noticing that you capitalized the if statement. if statements should not be capitalized because Lua is case sensitive.
--# Use this:
if expression then
--# Do stuff
end
--# Don't use this:
If expression then
--# The program will error before this
end
The next thing I would suggest is that you use
for loops in order to repeat an action. For loops are awesome, and you can find out all about them
here. An example of a for loop would be:
for n=1,10 do
print("Moving forward")
turtle.forward()
end
Another cool thing about for loops is that you can nest them, just like any other block of Lua code. Nesting is where you put a block of code into another block of code to run. For example:
for x=1, 10 do
for y=1, 10 do
print(x.." times "..y.. " = "..x*y)
end
end
Using nesting, you can easily achieve what you want here. However, sometimes it's nice to be able to repeat code over and over again, but separated by other statements. To do this we can use
functions.
function track() --# This is where we define what the function will do when we run it.
for n=1,10 do
turtle.forward()
turtle.placeDown()
end
end
track() --# This is where we actually run the function.
Functions are also awesome in that they can take input. For example:
function track(length) --# This function takes an argument and stores it in a variable called length, which we can use for the rest of the function
for n=1, length do
turtle.forward()
turtle.placeDown()
end
end
track(10)
Hopefully this will get you started with this

If you need any more help feel free to ask.