loadlines will return an array, I believe, which is the reason what you are doing is not working. You'd need to do something like...
PHP Code:
temp.testload.loadlines("levels/gmap/temptest.gmap");
for (temp.i=0;i<temp.testload.size();i++) {
temp.testload[i] = replacetext(temp.testload[i], "rofltest", "loltest");
}
temp.testload.savelines("levels/gmap/lolxdd.gmap", 0);
Also, you can just use shared.replacetext(x,y,z) instead, as you don't need to add the function.