Ok, maybe I misunderstood the title/query of the thread, but there is no need to convert a TradingView Indicator script into actual 'MT4 code'.
The more efficient way is to convert the TradingView Indicator into a TradingView Strategy. Identify the 'alertcondition' from the indicator script and add these as 'alert' trigger to the strategy script.
Configure a TradingView Alert with a Webhook/Connector to MT4 ... and the trades are send and executed on MT4 client.