The source code should have been provided with the original post and included as a plain text file attached to the question. But at least we managed to get the code provided in the comments section below the question. The problem with this is that code posted in the comment section is stripped of all formatting.
Once you format that code to restore the line breaks after each ";" symbol we end up with 15 lines of code. To convert this to a scan you delete the last 6 lines of code and add the following for the scan signals:
plot scan = close < ST;
plot scan = close > ST;
You can only run one of those signals at a time. The first one returns stocks where the "SuperTrend" is red. The second one returns stocks where it is green.