Bubble sorting in progress
JavaScript (ES6), 102 82 80 86 80 bytes

Bug fix and 1 byte saved thanks to @edc65

(a,m)=&gt;eval("for(i=0;m;a[j=i-1]&gt;(b=a[i])?a[a[i]=a[j],j]=b:0)1/a[++i]?m--:i=0;a")


Recursion may not be is definitely not is probably the best approach, but I'm sticking with a loop for now.

Try it out:



f=(a,m)=&gt;eval("for(i=0;m;a[j=i-1]&gt;(b=a[i])?a[a[i]=a[j],j]=b:0)1/a[++i]?m--:i=0;a")
Enter your numbers:&lt;br&gt;
&lt;input id=A rows=10 value="5 1 4 2 8"&gt;&lt;br&gt;
Enter the number of steps:&lt;br&gt;
&lt;input type="number" min=0 id=B rows=10 value="1"&gt;&lt;br&gt;
&lt;button onclick="C.innerHTML=f((A.value.match(/-?\d+/g)||[]).map(Number),B.value)"&gt;Run&lt;/button&gt;&lt;br&gt;
&lt;pre id=C&gt;&lt;/pre&gt;