You could do something like this:
if(!$this->sql->query("SHOW TABLES LIKE 'cms_guestbook'")){
$this->sql->query("
INSERT
INTO cms_modules (title)
VALUES ('Guestbook')
");
}
You query to see if it finds a specific table and if it returns false (check to be sure it returns a boolean) you run your other query.