The slow performance you're experiencing when editing the OnVisible property in PowerApps, particularly with long code (such as 180 lines), is a known issue when working with large or complex applications. This problem stems from the live evaluation engine, which constantly analyzes and checks the app for errors as you type, leading to slow response times.
Here are a few approaches that can help mitigate this issue:
Your frustration with this issue is understandable, but until Microsoft improves handling large apps or provides an option to delay formula evaluation, these workarounds should help manage the problem to some extent.