Some script plugin hotfixes

Added fold line, and fixed double duplicates on ctrl+D.