The difference between your version and admin.sma is that the new cvar value is read inside a function called by a server command.
Commands sent with server_cmd() aren't executed immediately and that's why get_cvar_string() is reading the old value. You could try using server_exec() after server_cmd() or you could copy the workaround in admin.sma.