How to stop and reverse a modified servo motor?

I am currently on a project on how to make the servo stop at a certain point like 1080 degrees. and how to reverse is. I already have a code but I can't make the servo stop and reverse it. Can anyone help me adjust the code? My servo motor is 20KG torque power and will work on 6.6v.

#include "DHT.h"
#include <Servo.h>

#define DHTPIN 2 // what pin we're connected to
#define DHTTYPE DHT22 // DHT 22 (AM2302)
#define SERVOPIN 9

int maxHum = 60;
int maxTemp = 25;

DHT dht(DHTPIN, DHTTYPE);
Servo myservo; // create servo object to control a servo

void setup() {
pinMode(SERVOPIN, OUTPUT);
Serial.begin(9600);
dht.begin();
myservo.attach(9);
}

void loop() {
// Wait a few seconds between measurements.
delay(2000);

// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius
float t = dht.readTemperature();

// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
return;
}

if( t < maxTemp) {
digitalWrite(SERVOPIN, 180); // tell servo to go to position in variable 'pos'
delay(5000);

} if( t > maxTemp) {
digitalWrite(SERVOPIN, 0); // tell servo to go to position in variable 'posi'
delay(5000);

}

Serial.print("Humidity: ");
Serial.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
Serial.println(" *C ");

}

In what way has the servo been modified ?
Has its position feedback been removed to turn it into a so called "continuous rotation servo" ? If so then you cannot guarantee the position at which it will stop.

In any case this
    digitalWrite(SERVOPIN, 180);              // tell servo to go to position in variable 'pos' will not make the servo do anything sensible or, indeed, anything at all. digitalWrite() can only make a pin go HIGH or LOW and has nothing to do with positioning a servo.

Look at the examples from the Servo library to see how to drive a servo.

Actually the code was not from me I just tried searching it on the net and combine it with what I have seen. What I'm actually trying to do is controlling servo using DHT22(temperature sensor) to rotate it clockwise at a specific temperature and also counter-clockwise. Can you please give some advice or help?