If you are looking to make it solid, you could potentially just use a brush:
Code:
int brush = CreateEntityByName("func_brush");
if (brush != -1)
{
DispatchKeyValue(brush,"rendermode","10");
//Toggleable
DispatchKeyValue(brush,"solidity","0");
DispatchKeyValue(brush,"solidbsp","1");
DispatchKeyValue(brush,"startdisabled","0");
//If you have the m_ModelName of the volume you wish to block, then you can set it here and skip the SetEntityModel and vMins and vMaxs.
//DispatchKeyValue(brush,"model",ModelName);
//If it is just slightly too small, then you will need to get the min maxs and ScaleVector(1.05,vMins) and vMaxs and set it below.
float targetpos[3];
float targetangs[3];
//Here you could set a static position, or get the position of the volume you want to block.
TeleportEntity(brush,targetpos,targetangs,NULL_VECTOR);
DispatchSpawn(brush);
ActivateEntity(brush);
//The model in particular doesn't really matter, it is just to set the bounds configuration.
//It would be good to note, while the bounds of this model doesn't affect the player clip, it will affect NPCs and some props by the bounds of the specified model.
if (!IsModelPrecached("models/somemodel.mdl")) PrecacheModel("models/somemodel.mdl",true);
SetEntityModel(brush,"models/somemodel.mdl");
int effect = GetEntProp(brush,Prop_Send,"m_fEffects");
effect |= 32;
SetEntProp(brush,Prop_Send,"m_fEffects",effect);
float vMins[3];
float vMaxs[3];
//You can either set a static value here,
//or get the min max of the volume you are trying to block.
//There is also a potential that if you are blocking entering a map based trigger volume, then you can get its model and set it then skip the minmaxs.
if (HasEntProp(brush,Prop_Send,"m_vecMins")) SetEntPropVector(brush,Prop_Send,"m_vecMins",vMins);
if (HasEntProp(brush,Prop_Send,"m_vecMaxs")) SetEntPropVector(brush,Prop_Send,"m_vecMaxs",vMaxs);
}