How to use a value from insert in conditional insert in postgres
You can use a CTE to supply the values:

with data (street, city, user_id) as (
  values ('street1','LA', 2)
)
insert into addresses(street, city, user_id)
select *
from data
where exists (select * 
              from users
              where users.id = data.user_id 
                and users.storeaddress = true);


Or alternatively a derived table:

insert into addresses(street, city, user_id)
select *
from (
   values ('street1','LA', 2)
) as data (street, city, user_id)
where exists (select * 
              from users
              where users.id = data.user_id 
                and users.storeaddress = true);