How do I create a button on the ribbon and how do I move the selected item(s) from the list/library into a Document Set?
Here you have something quite similar (just few changes needed):
Basically you need two things:
- Custom ribbon/button similar to one described in article. With usage of dialog framework you open custom page and pass selected items values as querystring (all described in provided article)
- Custom Application page with one TextBox (DocumentSet name) and 2 buttons (OK, Cancel). OnLoad you read selected items from query string (article) and on button OK click you create your Document Set and move selected items into it (not in article!)
For that last part you can use info provided here: How to programmatically create document set, add or move files, GetDocumentSetById
For more info on Ribbon customizations I recommend reading SharePoint 2010 Ribbon Customization series by Chris O'Brien (@ChrisOBrienMVP).
Addition (thx goes to @StuartPegg):
Some info on how to enable Ribbon Button when item(s) in list is(are) selected: