Having concluded his experiments Tails still wouldn't let Sonic leave his lab until acknowledged his love for him by saying something attractive about him. Tails altered and warped his lab with an invention he made using one of the Chaos Emeralds as a catalyst in case Sonic tried to run away from him, causing him to immediately get lost for recapture.
Sonic still resisting with resilience he just played it off after those experiments and reminded Tails that even though he's in love with his bkue speedy friend that he's still a dorky fox kid that loves nerdy things and Tails immediately agreed and released him just like that. Easy dialogue win.