I think sed is a more regular and friendly tool that is usually faster and easy to use. Awk has more strength in delimited many-field records. I am ot much of an awk user, and I don't think either is great about multi-line blocks, but sed is pretty good, as you can pile up lines in the buffer.
sed '
:loop
/^>ref|'$input'| *$/!d
:loop2
$b
N
P
s/.*\n//
/^>...|.*| *$/b loop
b loop2
' $in_file
Narrative: sed opens $in_file and examines every line.
Set a branch tag called 'loop'
If we do not find the desired $input in a header line, delete this line (which starts the script over on the next line).
Set a second branch tag 'loop2',
if at EOF, branch (to end of script = print and exit),
get the next line into the buffer after the first and \n,
print the first line,
delete the first line and \n,
if there is a header in the buffer, loop way back to :loop,
branch to loop2 to continue printing the block.
You can see the simple commands in sed allow easy reuse. I call this sort of sed a looper script. Some sed scripts just work on one line, so I call them filter-transform scripts. If you need both at once, you can pipe one sed to the next. Sed is fast and has no size limits.
I see an awk guy bartus11 has given us a one line awk script. I could one line, I guess, but I like to make it easy to read and maintain. The '.' in your $input is the sed metachar for any char, but that does not seem a very big weakness. I used more definition on the header line, so you can have <>| in the text without side effects. Is every '^>[^|]\{3\}|[^\]\{1,99\}| *$' line a header? I may have used too much definition, with /^>ref| so I will revise -- poof! Always >...|?
I ran the one line awk script and turn out to be symbol">" is missing in the output file. How can I can the ">" remained in the very beginning like ">ref|NP_253535.1|"?
I'll also be nice if you can explain to me what is "vRS".
Well, UNIX optarg can be confusing, especially when awk has multi-letter commands in non sh style mixed in. Probably equivalent to "-v RS=...". I am not an optarg fan, as it makes things confusing to save a key stroke or two: training and mistakes are more expensive. For instance, "-abcde" might mean "-a 'bcde'" or "-a -b 'cde'" OR . . . "-a -b -c -d -e" depending on which if any one letter option takes an argument.
Looks like xpg4 awk or nawk (new awk) or the wrong O/S man page: