Reusing select statement
Create a view vw_HousesAccess  which will contain following query and then



        Create View vw_HousesAccess  
        as 
        Select * --TODO specify columns where 
        FROM Houses 
            INNER JOIN Houses_Access ON Houses.ID = Houses_Access.DoorKey
            FULL OUTER Join UserAccess ON  Houses_Access.GroupKey  = UserAccess.GroupKey

        ---then in main query you can use like this. 
        IF Exists(Select 1 from vw_HousesAccess  where  WHERE ID IS NOT NULL AND ID = @DoorKey AND UserKey = @UserKey)
         ---your logic