Assuming your data is projected and that the distance between the points and the two nearest polygon is the one you are looking for, you can compute the distance from each point to the two polygons and make the sum.
1) compute the distance. Restrict the search to a reasonable distance, maybe twice the expected largest distance. Make sure the geometries are indexed!!
SELECT pt.gid point_gid, plg.gid polygon_gid, ST_Distance(pt.geom, plg.geom) distance
FROM pointlayer pt, polygonlayer plg
WHERE ST_Distance(pt.geom, plg.geom) < 50
ORDER BY pt.gid, ST_Distance(pt.geom, plg.geom);
2) For each point, get the two closest polygons using the partition function
SELECT
point_gid, polygon_gid, distance
FROM (
SELECT
ROW_NUMBER() OVER (PARTITION BY point_gid ORDER BY distance asc) AS rank,
t.*
FROM
[distanceTable] t) top_n
WHERE
top_n.rank <= 2;
3) agregate the result and keep track of which polygons were used
select point_gid,
sum(distance) streetwidth,
string_agg(polygon_gid || ' - ' || distance,';') polyid_dist_info
from [top_2_dist dst]
group by dst.point_gid;
All together:
SELECT
point_gid,
sum(distance) streetwidth,
string_agg(polygon_gid || ' - ' || distance,';') polyid_dist_info
FROM (
SELECT
ROW_NUMBER() OVER (PARTITION BY point_gid ORDER BY distance asc) AS rank,
t.*
FROM
( SELECT pt.gid point_gid,
plg.gid polygon_gid,
ST_Distance(pt.geom, plg.geom) distance
FROM pointlayer pt, polygonlayer plg
WHERE ST_Distance(pt.geom, plg.geom) < 50
) t
) top_n
WHERE
top_n.rank <= 2
GROUP BY point_gid;