Dry the tofu. Drain the tofu, wrap in a clean towel or paper towels, and press 20 minutes (a plate with a heavy can on top works). Pat dry, then crumble into small pieces resembling ground meat.
Heat 2 tbsp oil in a wok or large skillet over medium-high heat. Add the tofu in a single layer — cook in two batches if the pan is crowded. Cook until golden and dry-ish, several minutes per side. Remove and set aside.
Add a little more oil if the pan is dry. Add the garlic and chiles; stir-fry about 30 seconds until fragrant.
Add the green beans and stir-fry 2 minutes until bright green and tender-crisp. A splash of water helps if the pan is too dry.
Return the tofu to the pan. Stir the soy sauce, dark soy sauce (if using), vegetarian oyster sauce, and sugar together, pour over, and toss 2 minutes until coated and the sauce has cooked down.
Turn off the heat, add the Thai basil, and toss until just wilted. Serve over jasmine rice.