Like Geforce Fan said, you can use term.getSize() to see how large the screen is:
w,h = term.getSize() --# w is the x axis, h is the y axis
Then, instead of using a set position (Like 'term.setCursorPos(3,4)'), use the width and height to position it (term.setCursorPos(w/2,h/2))
If you ever wanted to know what kind of computer is running your code, you can use this handy function:
local function getComputerType() --Handy function
local ret = {}
if term.isColor() then
table.insert(ret, "advanced")
end
if pocket then
table.insert(ret, "pda")
elseif turtle then
table.insert(ret, "turtle")
else
table.insert(ret, "computer")
end
return table.concat(ret, "_")
end
For example, on a regular pocket computer, it would return 'pda'
On an advanced turtle, it would return 'advanced_turtle'