#Dyalog APL 16.0 (non-competing), 43 bytes
Prompts for comment character, then for code.
⎕ML←3⋄⊃(↓⊃((-(⍸'|'∘=),≢)↑¨'|'∘≠⊂⊢)⍞),¨⊂¯2↑⍞
Non-competing because version 16.0's is newer than this challenge.
#Dyalog APL 16.0 (non-competing), 43 bytes
Prompts for comment character, then for code.
⎕ML←3⋄⊃(↓⊃((-(⍸'|'∘=),≢)↑¨'|'∘≠⊂⊢)⍞),¨⊂¯2↑⍞
Non-competing because version 16.0's is newer than this challenge.