This phrase is used to refuse a certain statement in a sassy yet friendly and humorous way.
Person 1: “Can I go to the movies with you guys?” Person 2: “Nay Nay shanay nay! You gotta study”