After some more experimentation, I was able to make the following changes to the mapInside function
float mapInside(float val, float min, float innerStart, float innerSize, float uDimensions, float uBorder) {
float scale = uBorder / uDimensions;
if(fract(val * scale) < uBorder)
{
return fract(min*scale);
}
if(fract(val*scale) > innerStart + innerSize)
{
return fract(min*scale);
}
return mod((val - min) * scale, innerSize) + innerStart;
}
I noticed by dividing the original size by the new size I could get the scale. When I did that it was repeating the center section, but it was repeating it at the edge of my central section. So, if my central section was 18 pixels, this would repeat it every 18 pixels. When resizing to 96, this meant it was drawn 5 times, instead of the three that I wanted. If I account for values outside of the range I want and just draw the value I want at those places, it seems to fix my problem. Here is my example sprite resized to 96x96
And here it is resized to 56x32. You can see the interior pattern is cut off as it cannot be completed.
This works well enough for me. If anyone comes across this, note my use of fract(min*scale) for the values outside of the central parts I want is fairly arbitrary, I just happen to know that the results there are going to be the colors I want. Were that not the case, if my shape instead looked like this
you end up with something that looks like this
There's probably a simpler way to do this, but it works for me, so I'll call this solved.