So I have tried some more, with the simple king rapids, the one on the left with roofs directly above the track is considered sheltered, but the one on the right is considered not sheltered with or without the vertical walls makes no difference. There may be a limit to how close the tiles must be to the vehicle during testing, but I fail to see the logic in the code.
I have also tested with the dejavu, but for this track I failed to have it considered sheltered even if all the tracks and queue path are covered with glass roof, still no one wants to go in. Strangely I remember in another saved game it worked, but now I cannot replicate it.
rct_tile_element * tile_element = map_get_surface_element_at({x, y});
if (tile_element->base_height * 8 <= vehicle->z)