Actually, I think I've misread your code.
. I was thinking that you create/remove the hat each time. -_-' . But your method is fine, though the client_connect/disconnect part is not needed. ( even if I prefer my method :p )
If we keep your code, something like should be enough :
public fwHamPlayerSpawnPost( const player )
if ( get_pcvar_num( g_Enable ) && is_user_alive( player ) && !g_bwEnt[ player ] )
g_bwEnt[ player ] = engfunc ( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) );
set_pev( g_bwEnt[ player ], pev_movetype, MOVETYPE_FOLLOW );
set_pev( g_bwEnt[ player ], pev_aiment, player );
engfunc( EngFunc_SetModel, g_bwEnt[ player ], "models/santa_hat.mdl" );
Though, replacing !g_bwEnt[ player ] by !pev_valid ( g_bwEnt[ player ] ) would not be a bad idea.