Taking the ball inside the field of play then going back to the ingoal area to force it would be a 5m scrum.
Going over the dead line ball is equivilent to grounding it. In either case -- 5 metre scrum with the put-in to the attacking side. IRB Law 22.7 (d) and 22.11 (b)