Updating a resource would work, but setting the TV value that way is a little clunky.
Since you have the TV object, this single line would be easier and a little faster:
$tv->setValue($resourceId, 'SomeValue');
I think you would still have a cache issue because, IIRC, TV values for a resource are stored in the cached version of the resource, though you should only need to clear the resource cache. I could be wrong.
If you use runProcessor() to create the TV, the TV object is in the return value, though you have to ask nicely for it. This is cribbed from creating a resource, but since all processors return the same type of object, it should work for TVs:
$response = $modx->runProcessor('tv/create', etc');
$tvObject = null;
if ($response->isError()) {
if ($response->hasFieldErrors()) {
$fieldErrors = $response->getAllErrors();
$errorMessage = implode("\n", $fieldErrors);
} else {
$errorMessage = 'An error occurred: ' . $response->getMessage();
}
$modx->log(modX::LOG_LEVEL_ERROR, $errorMessage);
return '';
} else {
$tvObject = $response->getObject();
$tvId = $object['id'];
}
if ($tvObject) {
$tvObject->setValue($resourceId, 'SomeValue');
}