A fast-growing number of the global population is expected to live in urban areas, posing challenges such as densification, climate change, and socio-economic disparities, highlighting the urgent need for sustainable development. Urban green spaces, as a nature-based solution, enhance ecological functions like carbon sequestration and climate adaptation, while fostering social cohesion and mental wellbeing. In rapidly growing megacities like Shanghai, urban greening policies aim to meet sustainability goals by 2035. However, current research often employs a backward-looking approach, using existing data and neglecting forward-looking impacts that consider long-term interactions between environmental and social factors, such as land use, population mobility, and commuting patterns. Although spatial general equilibrium models have been used to assess policy impacts on urban dynamics, they have not yet incorporated environmental components. This study addresses these gaps by introducing a developed Spatial Computable General Equilibrium (SCGE) Model, which comprehensively predicts the long-term impacts of urban green spaces on both environmental and social well-being. The findings reveal that while urban green spaces significantly promote sustainability goals, rising housing costs and increased intra-city migration may undermine these benefits. Furthermore, enhanced green amenities may inadvertently raise transport-related carbon emissions. This research underscores the importance of policy modification that maximizes environmental benefits while mitigating adverse social challenges, providing critical insights for policymakers to optimize urban green spaces in sustainable city initiatives.