Once I understand the request I will update the title of your question because "Two bar indicator" tells me nothing. After reading your description I see you mention inside and outside bars and something about wanting to find them side by side. But you did not specify in what order. Outside bar followed by inside bar or inside bar followed by outside bar. Or either one so long as any inside bar is next to any outside bar.
Your screenshot seems to hint that you would like to mark candles only when an outside bar is followed by an inside bar. That is the pattern you circled on your screenshot. But having to piece together bits and pieces of what you are requesting makes for a very confusing post.
So please state the request in perfectly clear terms so that I understand exactly what solution to provide.
Edit: In the comments section below we have clarification about what is being requested. The code is intended to mark outside bars with orange arrow and inside bars with white arrow but only when there is a pair of inside and outside bars together. (in any order)
Pretty sure this will fit that description:
def insideBar = high < high[1] and low > low[1];
def outsideBar = high > high[1] and low < low[1];
def pattern = insideBar and outsideBar[1] or outsideBar and insideBar[1];
plot signal = pattern or pattern[-1];
signal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
signal.AssignValueColor(if outsideBar then Color.LIGHT_ORANGE else Color.WHITE);
There is absolutely no need to create variable names for the high and low before using them in your patterns. That is just a waste of space, time and effort. It is also very poor form to use signal characters for variable names. You should never use variable names such as "s". Spell out the variable names using camelCase. The code will be much easier to read and maintain.