The first function shuffleInterval[x_List, n_] takes a List and an another vatiable n, with no constraints but assumed to be Integer(s); which returns a List of Interval(s) and original Integer(s) from x in position order as we are using Map. So the return list shapes as follows (psuedo-code):
{{Interval[x(i) - n, x(i) + n], x(i)},...}
where x(i) is the value based on position on the incoming List. This is why I used Table in my first post for easier understanding. So, on to the next step/function broken down. lappingShuffles[x_List, n_] takes output from shuffleInterval[x_List, n_] as z and accumulates, using Map and a Select function, the x(j,k,l,m,...)(s) and its Interval; where x(i) is a member of that interval. So the return list shapes as follows (psuedo-code):
{{{Interval[x(i) - n, x(i) + n], x(i)}, {Interval[x(j) - n, x(j) + n], x(j)}}, ...}
The next function gatherlappingShuffles[x_List, n_] takes output from lappingShuffles[x_List, n_] as z and takes the second column of each items of z. So the return list shapes as follows, for example (psuedo-code):
{{x(i),x(j)}, x(j), {x(k), x(l), x(m)}, ...}
This is the result which we take the Floor Mean of. However, you are stating that the functions as presented are not gathering or grouping properly, thus the Mean is off or presentation is confusing.
So how to test that gatherlappingShuffles[x_List, n_] is working as designed and as OP requested. To test just call gatherlappingShuffles[x_List, n_]. Say gatherlappingShuffles[myxIntegers, 20] and see what it returns. Then apply/map Floor Mean to each item on the list. Or on a few of those list items do some calculations by hand see what you get.
What are the rules you have in mind for the weights, if any? Otherwise, I thought I was faithfuly interpreting your request.
I thought I was being clear that the only reason I split up the functions is for you to better study the process. Each function can be called individually, with the same parameters, and their results can be observed. Just as I did in a previous post NumberLinePlot[shuffleInterval[myIntegers, 10]] to plot.
For example try:
{myxIntegers,
myyIntegers} = {BlockRandom[RandomInteger[100, 100],
RandomSeeding -> 42],
BlockRandom[RandomInteger[100, 100], RandomSeeding -> 44]};
gatherlappingShuffles[myxIntegers, 20]
All the next function does is Map the Floor Mean functions to each item. The above statement assumes that all 4 ...Shuffle(s) functions are defined.
Whether the solution paths provided are functional and/or make use of recursion; I can't truly speak to that. It may be best to clearly state your problem and goals. And see if this community can help you find other functional solutions. I interpreted your request to avoid procedural programming to mean use a functional programing paradigm.
"Functional programming is a programming paradigm in which we try to bind everything in pure mathematical functions style. It is a declarative type of programming style. Its main focus is on 'what to solve' in contrast to an imperative style where the main focus is 'how to solve'. It uses expressions instead of statements. An expression is evaluated to produce a value whereas a statement is executed to assign variables."
But WL provides a good environment for exploration.
So if the Mean is not what you want change it.
Please, note that Dynamic(s) are tricky. My best guess is that you may want to wrap these Dynamic variables and Slider(s) in a DynamicModule.