How to achieve two things:

1) how to add into vBulletin 4 the Youtube BB code tag/button to embed Youtube or any other video:

Go to AdminCP, Custom BB Codes, BB Code manager, Add new

title and tag name: youtube
replacement:
Code:
<iframe width="420" height="315"
src="https://www.youtube.com/embed/{param}">
</iframe>
Example: [youtube]6Bd-ESafWjc[/youtube]
Description: Please enter ONLY video code without any parameters and without full address.
Use {option}: No
Button Image (Optional): upload 16x16 YT image to your site directories and link to it in full address or just ./images/youtube16x16.png

Remaining radio buttons on Add new BB code set to: Yes

2) how to search and replace inside all vBulletin 4 posts

People used wrong format in their vBulletin 4 posts: [YOUTUBE]http://www.youtube.com/watch?v=....[/YOUTUBE]
And i needed to convert it to above setup BB code format: [youtube]6Bd-ESafWjc[/youtube] (because maybe allowing people to post whole URL not just video identifier can result in malicious URL being included on page instead)

1. Backup MySQL posts table: Went into MySQL manager PHPMyAdmin (inside webhosting control panel), clicked posts table. Clicked to export. Selected Gzip compression and saved the backup. Ideally verify beginning and end of the extracted .sql file that it look complete forum posts table - it can be huge.
2. Inside PHPMyAdmin click Query tab and paste following:
Code:
UPDATE post SET pagetext = REPLACE(pagetext,'[YOUTUBE]http://www.youtube.com/watch?v=','[YOUTUBE]');
UPDATE post SET pagetext = REPLACE(pagetext,'[youtube]http://www.youtube.com/watch?v=','[YOUTUBE]');
Verified result on the forum. It worked for me. If not worked for you, you may try to adjust queries or at worst, emptying the posts table and restoring your previously made working backup - do this only if you are sure you know how to do it.